Where to place twitter4j.properties in android project? - android

I'm developing Twitter application with xAuth support using twitter4j jar file.
I want to place my consumer key/secret in twitter4j.properties file.
Where should I put this file in directory structure?

On Eclipse project, put in "src" directory just below.
On Android Studio (gradle-style) project, put in /app/src/main/resources/ .

twitter4j.properties should be located
under either the default directory,
the root of your classpath, or the
WEB-INF/ directory
heres the doc.
http://www.devcomments.com/Twitter4J-now-supports-xAuth-at106339.htm

Related

How to set project file name in IntelliJ IDEA?

I am writing an Android app using IntelliJ IDEA.
My project file is generated as android.iml because my project folder is named android.
The project folder of my partner is named cleverlotto (app name). Because of this IntelliJ generates a second project file named cleverlotto.iml.
Now we are working with different project settings.
So how can we use the same project file without using the same project folder name?
I asked the same question to Jetbrains Support.
Answer:
It is not possible to rename root module without also renaming root
directory of the project.

Android how to extract *.so file during execution

I have one android myLibrary.jar file. But myLibrary.jar file will load the native 3 different so file. I have a.so, b.so and c.so.
When i using in my own application, it just simply put the jar file to the Android Dependencies and all 3 so files put in the libs/armeabi of the main application package.
When deploy and install on the device, these so file will be in the data/data/my-appname/lib/*.so.
Now i need to provide the sdk solution. The user side doesn't want the main application. They just want the myLibrary.jar. So i am considering about packing all 3 *.so files to the jar. I searched for the how to add to the so files to myLibrary.jar. But i still don't understand.
In this following post:
[Ant]How to add .so file into a jar and use it within jar(set the java.library.path)?
It mentioned about adding the so file to the jar and extract at runtime. But i still don't understand how to achieve that.
After trying that mentioned in the following post:
Creating a product SDK: How do I add a native lib (.so) and a jar with the SDK I am creating?
After my sample application reference the the compiled jar that included the .so file. After installing to the device, the libs/armeabi/xxx is not unpacked on the install. So i would like to know how to extract them dynamically and save them to data/data/my-appname/lib/ so that i can use with System.loadlibary(.so).
Thanks a lot.

How to add a framework to Eclipse?

I need Simple xml parser for my project. I read throu it's site but i couldnt find how should i add it to my project to use it properly.
I programming in android using eclipse.
This is the site of Simple.
You have to do the following:
Download jar or zip of the Simple parser here
Copy it into the directory where the libraries of your project is located.
Let Eclipse knowing it by adding the library into the classpath
In order for the jar to be available at runtime, you need to:
Put the jar under your assets folder
Include this copy of the jar in your build path
Go to the export tab on the same popup window
Check the box against the newly added jar
last part is from here

Android how to export jar with resources?

I create an Android project for build my custom widget, and I want to export it as a jar for other project so that reuse them conveniently, but now a problem is, I can't use resources which is included in my custom widget jar, for example a png picture, it gets a null from the resource Id of class R! How can I sovle it?
Update question:
How can I parse LayerDrawable xml from assets folder in code?
You cannot export self-contained Android Library jar at this time and announced will be available in the future SDK release.
https://developer.android.com/guide/developing/projects/index.html#LibraryProjects
You cannot export the Android Project to Jar with Resources. What you can do is Make First Project as Library and then Add that to another project.
See Documentation Here shows how to Setup a Project as Library and use in another Project
In order to get the app working with my exported library .jar file, I had to copy everything in the resources directory "res" from the library project to the application project. Also had to merge file string.xml as well as merge the ApplicationManfiest.xml files as well. To add the project as a library through eclipse is much simpler.

Android: HowTo generate Jar for the added framework

I am trying to add some 3rd part framework in android code. The framework is set of java files.
My questions is how to generate Android Specific Jar for this framework so that my applications can use it. What and where am I missing the generation of Jar.
Any suggestions.
What I do to generate jars is create an android project, put the classes inside a package on the src folder and then export the src folder as JAR with Eclipse.
Then add that Jar in your build path on the main project

Categories

Resources