New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is it possible to import the project int android Studio and compile using NDK? #3444
Comments
Hi, I've just given this a whirl and managed to successfully open the Android Tensorflow Demo under Android Studio and build it from there. You'll still need Bazel for building the native libs, but you'll be able to get full Java support through Android Studio. Some of these steps are shared with Instructions: Download Android NDK r11c and unzip it somewhere:
Clone repo:
Now edit Install Assets for Demo:
Build native libs:
Set up the Android Studio project:
Build the APK With any luck, this should create a working APK! You'll need to re-run the "Build Native Libs" instructions any time you modify .cc or .h files, but you should be able to edit the Java code as you normally would for any other Android project. In the future we may better support Android Studio with cmake support, so that some of these steps would be unnecessary. |
Just to followup on this, there is now a build.gradle for the Android demo that will automate most of this if you just add the tensorflow/examples/android dir as an existing AS project. You'll still need to have Bazel installed, though. |
Error on Sync build.gradle
Works fine when I comment the line |
@riless Seems to be a change/bug in Gradle 2.2: https://code.google.com/p/android/issues/detail?id=219732 A workaround may be to rewrite it as:
|
|
Can anyone guide me? I want to take the scoreView result as recog.getTitle() in a texview. |
@CodeLoverr It sounds like you just want to call view.setText(recog.getTitle()). But please direct general Android programming questions to StackOverflow, you'll find better support for that there. |
I was trying to import the project into android studio and work on it.
Getting lot of compilation issues on jni compilation.
Is it possible to do that?
Any constraints we have ?
The text was updated successfully, but these errors were encountered: