How can you add external dependencies to bazel - android

I am a student and currently working on a project where I am trying to connect my game that which I have created with Android Studio. A neural network has also been made with Tensorflow which is going to be used for the android game.
The problem is that Android Studio uses a build tool which is called Gradle and Tensorflow uses Bazel. To solve this problem I have been trying to build my android game with Bazel but I am stuck at the part where I have to add the used external dependencies. For the game I use the following dependencies:
Appcompat
Support
Percent
Which supposedly should come with the android support repository.
I have looked at http://www.bazel.io/docs/external.html and several other sources but I still do not understand how I can add the dependensies. Could someone provide me with an example how to do it with for example appcompat and what I have to do to make it work? Or is there another way which would be easier?
EDIT: I have have been succesful in building the android example of Tensorflow but this: https://github.com/tensorflow/tensorflow/tree/master/tensorflow/examples/android
But it doesn't include dependensies which I am using.

You may want to look at the Makefile support we just added for Android:
https://github.com/tensorflow/tensorflow/tree/master/tensorflow/contrib/makefile
It's still very experimental (and fiddly), but should let you build a static library that you can more easily use in your gradle project.

Nevermind I resolved my issues, after removing the depensies I checked the WORKSPACE file. It seems I didn't set the package correctly, my bad.

Related

how to remove android library from within project and place it in Github

I have an Android project in which I have added Android library as a module and use it within the project. Android library module is part of the project.
what I want to do is, remove the Android library from the project and host it in Github and use the Android library as a dependency in Android project.
Is that possible, if so how can I achieve that please.
If you think I should not be creating a Android library within the Android project I want to use it in, and create Android library as a separate project do let me know as well. (But this was it is a bit hard to debug I think)
Your suggestion and advice will be very helpful
Thanks
R
You need to publish your Library to Github Packages in order to use it as a dependency.
Follow this tutorial to do it.
Update 1
Another way to do that is by using JitPack. You just need to publish your library into Github repository and then you create a dependency using JitPack from that repo.

Android Studio Gradle Dependency Check

I am trying to develop a Google Play Services like structure which is split into its own separate components (libraries) that can be added to Android Studio as dependencies. For example what is displayed below;
Like the Play Services libraries I would like to force the user to use the same version for all the libraries when adding more than one, as seen below;
I am wondering how the build.gradle file determines this? Is it built into Android Studio, is it coming from the build tools plugin?
As I would like to do something like this, if anyone has any helpful suggestions/links it would much appreciated.
You can use Lint to define custom rules based on your needs.
There is a really good explanation on topic with an example on Android Studio Project Site.
An easy way to start defining your own Lint rules is by modifying the sample project provided at this link http://tools.android.com/tips/lint-custom-rules/customlint.zip?attredirects=0&d=1
This way you will have all the dependencies set up to use the Lint APIs.
Source http://tools.android.com/tips/lint-custom-rules

Adding 3rd party libraries to Android.Xamarin

How can I add Android 3rd party libraries to Xamarin project using Xamarin Studio?
EDIT
I want to add this from GitHub. In android studio I would add dependency to Gradle like this:
dependencies {
compile 'com.antonyt.infiniteviewpager:library:1.0.0'
}
but what is the solution in case of Xamarin if I don't have .jar?
I tried to follow this guide to Bind a Java Library but without success.
xamarin dont have buttterKnife libralry but you can check this component is like butterknife library and check this on how to instal components in xamarin
As Kastriot mentioned earlier, you can try other libraries such as:
CheeseKnife - https://components.xamarin.com/view/cheeseknife
Genetics - https://components.xamarin.com/view/genetics
These should both be available on NuGet as well.
If you want the original library, you can create a Xamarin Android Binding Project
https://developer.xamarin.com/guides/android/advanced_topics/java_integration_overview/binding-a-java-library/
Or you can work on a Java -> C# port of the original library like the ones above.
in xamarin you wont be able to do things like you did in gradle but you can add a binding project to bind the java to .NET for you
now you could either go through workout explained in this link for AAR files (that requires you to download and compile your intended libraries manually)
or
check this little extension from visual studio gallery, it is really easy to work with.
i have tested it myself and it works nice.

how to use android project library in eclipse?

I am new in android. I see a lot of android libraries out there like github.com but when I download them none of them are a *.jar file like this one:
NumberProgressBar
It seems that all these libraries are for android studio NOT eclipse (Am I correct? This is important).
My question is: How do I use these libraries in eclipse?
I tried to import the downloaded library as an android project and then mark it as "is library" and then add to my project, but that did not work.
That library is designed to be built with Gradle for Android (with or without Android Studio), producing an AAR.
Eclipse does not have native AAR support. I have published a recipe and a Ruby script to convert an AAR into a library project that Eclipse can use, though I have not tested it much.
Or, you can download the source code and attempt to reorganize it into an Eclipse-style library project.
I just downloaded it and add it as library project and everything looks fine. How do you do it, it's extremely simple. Let us know in which step you have a problem so we can figure out what is wrong.
You have to build the library first.
For your example, read the Readme file, section 'Build'.

Android project depends on java project

I've been playing with a Java's Magento connector called magja (https://github.com/magja/magja) in a 'normal' Java project. And everything were working fine till this point.
After that, I started a simple Android application that would use the magja code to consume such information from Magento.
The question is: how should I configure the my Android project to deal with a 'normal' Java project (not a library)? This another project uses several xml files to configuration and Maven to deal with dependencies. How this impacts my Android App?
Thanks a lot!
EDITED
Actualy, I've already tried this approach (Android project unable to reference other project in eclipse), but always when the app tries to run the 'project B' (magja) code, it causes a
java.lang.NoClassDefFoundError: org.apache.commons.httpclient.params.HttpConnectionManagerParams
I believe it's related to some .jar files that magja uses. It looks like that I would solve the problem if I could share such library between the projects.

Categories

Resources