Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Intelligent Mobile Projects with TensorFlow

You're reading from   Intelligent Mobile Projects with TensorFlow Build 10+ Artificial Intelligence apps using TensorFlow Mobile and Lite for iOS, Android, and Raspberry Pi

Arrow left icon
Product type Paperback
Published in May 2018
Publisher Packt
ISBN-13 9781788834544
Length 404 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Jeff Tang Jeff Tang
Author Profile Icon Jeff Tang
Jeff Tang
Arrow right icon
View More author details
Toc

Table of Contents (14) Chapters Close

Preface 1. Getting Started with Mobile TensorFlow FREE CHAPTER 2. Classifying Images with Transfer Learning 3. Detecting Objects and Their Locations 4. Transforming Pictures with Amazing Art Styles 5. Understanding Simple Speech Commands 6. Describing Images in Natural Language 7. Recognizing Drawing with CNN and LSTM 8. Predicting Stock Price with RNN 9. Generating and Enhancing Images with GAN 10. Building an AlphaZero-like Mobile Game App 11. Using TensorFlow Lite and Core ML on Mobile 12. Developing TensorFlow Apps on Raspberry Pi 13. Other Books You May Enjoy

Setting up Android Studio

Android Studio is the best tool for Android app development, and TensorFlow has great support for using it. Unlike Xcode, you can install and run Android Studio on Mac, Windows, or Linux. For detailed system requirements, see the Android Studio website (https://developer.android.com/studio/index.html). Here, we'll just cover how to set up Android Studio 3.0 or 3.0.1 on Mac – all the apps in the book have been tested on both versions.

First, download the Android Studio 3.0.1, or the latest version if it's newer than 3.0.1 and if you don't mind fixing possible minor issues, from the preceding link. You can also download 3.0.1 or 3.0 from its archives at https://developer.android.com/studio/archive.html.

Then, double-click the downloaded file and drag and drop the Android Studio.app icon to Applications. If you have a previously installed Android Studio, you'll get a prompt asking you if you want to replace it with the newer one. You can just select Replace.

Next, open Android Studio and you need to provide the path to the Android SDK, which by default is in ~/Library/Android/sdk if you have a previous version of Android Studio installed, or you can select Open an existing Android Studio project, then go to the TensorFlow 1.4 source directory created in the section Setting up TensorFlow on MacOS, and open the tensorflow/examples/android folder. After that, you can download the Android SDK by either clicking the link to an Install Build Tools message or going to Android Studio's Tools | Android | SDK Manager, as shown in the following screenshot. From the SDK Tools tab there, you can check the box next to a specific version of Android SDK Tools and click the OK button to install that version:

Fig 1.4 Android SDK Manager to install SDK tools and NDK

Finally, as TensorFlow Android apps use the native TensorFlow library in C++ to load and run TensorFlow models, you need to install the Android Native Development Kit (NDK), which you can do either from the Android SDK Manager shown in the preceding screenshot, or by downloading NDK directly from https://developer.android.com/ndk/downloads/index.html. Both the NDK version r16b and r15c have been tested to run the Android apps in the book. If you download the NDK directly, you may also need to set the Android NDK location after opening your project and selecting Android Studio's File | Project Structure, as shown in the following screenshot:

Fig 1.5 Setting project-level Android NDK location

With both Android SDK and NDK installed and set up, you're ready to test run sample TensorFlow Android apps.

You have been reading a chapter from
Intelligent Mobile Projects with TensorFlow
Published in: May 2018
Publisher: Packt
ISBN-13: 9781788834544
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image