In an effort to reduce duplication, I have my app's workspace split into 3 projects: Main (A library project, where all of the common code lives) Free (To make the free version) Paid (To make the paid version) Behavior in the free version and the paid version must differ sometimes. How can I "call into" the final projects from the library project? Here is some sample psuedo-code to illustrate my question: Code...
Currently I am trying to compile native code for Android. The code is from the OpenCV port for Android. I pasted all the code correctly in my project and edited my make files accordingly. When I set android:debuggable to false everything works fine and I get my native library. When I try while android:debuggable is set to true I get an error.
Here is a part of the log:
From what I have found on the internet this is caused by the optimization level of the compilation. As long as the code isn't compiled so that is is debuggable afterwards everything should be fine.
Now apparently it is possible to avoid this by setting APP-OPTIM := release in the Application.mk or adding -O2 to LOCAL_CFLAGS. I have tried both and still I get this error.
Right now I don't really care that much about debugging my native code, but I would like to have basic debugging enabled. And I don't want to keep switching android:debuggable in my manifest every time I want to compile. I'm not even sure if it is okay at all if I just set android:debuggable to false pre compiling and to true post compiling, but I am sure I will forget it every second run.
I've written some code for my Android device to login to a web site over https and parse some data out of the resulting pages. An HttpGet happens first to get some info needed for login, then an HttpPost to do the actual login process. The code below works great in a Java project within Eclipse which has the following Jar files on the build path: httpcore-4.1-beta2.jar, httpclient-4.1-alpha2.jar, httpmime-4.1-alpha2.jar, commons-logging-1.1.1.jar.
I have project A with some classes and some resources (used for classes configuration). I'd like to reuse its classes (and resources necessary for them) in another project B (and possibly in more projects). Currently I have 2 projects in Eclipse and they both builds fine, but when project B is started in emulator it fails with error.It should get classes and resources from both projects and package them together. 2) Make a third project which consists of symbolic links to classes and resources of those two projects. 3) Make project A as a service and consume it in project B. They all are imperfect: - 1 and 2 would pack classes and resources of project A into the .apk of project B. - 3 has performance penalty and reuse is not so easy.
I've been working on my project for a while and have decided to share it's source so that I can get help from people and finish it and post it to the market (it's a highly addictive and fun card game). However, I have published it on google code at: http://code.google.com/p/bestcardgameever-android/ And when I tried to download it with a friend that can help I kept getting messages saying that it is not an android project from eclipse I'd appreciate it if somebody could tell me exactly what needs to be uploaded and what doesn't need and how can I make it work - if you have done it before - you probably can easily help Thanks! also, if you can and want to generally join the project as a developer graphics person or web designer.
I want to be able to have two projects, one that contains production code and one that contains test code. This shouldn't necessarily be an Android-specific question, but I'm want to write some unit tests for some non-platform-specific Android code on the host PC.
I created a new Java project so I can run the unit tests on the PC and only include the non-platform-specific classes from the Android project. Both projects are opened in the same Eclipse workspace. I assume I need to somehow include these Android-project sources explicitly in the new project where I'll run the Junit tests, but I can't figure out how to do this.
I am currently moving from Xcode and iPhone development to Android with Eclipse. I want to have a shared code project so that I can store all the code to be shared across apps in one common library. However it would appear that the only android project available is for applications and not for code libs how can i achieve this?
I'm pretty new to android, and just finished setup my environment and reading some tutorials. Then I got sdk samples from the web. Okay, what I wanna ask you is that is there a way to start a sample as a project in the Eclipse? I mean like clicking a project file in c# or a solution file.code...
Or, do I need to make a new android project and import (or add files? maybe) them?
I am trying to create an app that gets the location and telephone number of the phone. This is the Code I am using to get the telephone number (I am focusing on sdk 1.5) and in the emulator this works.
I have implemented rotation of a custom view which runs perfectly on Emulator,but the screen goes blank without any error. When i disable the animation in code[commenting the lines] the view appears on device. Please help me out. if there is any fox for this.
I have an Android code base which uses APIs with settings to get different data for several apps. All apps use the same code base but with one or two design tweaks. So how do I re-use the main code base without having to copy the whole Android project each time?
iPhone uses multiple targets in the same project which works well. If android cant do this do I need to compile binaries of the code base in one project and then import into each new app project? If so how? I'm using Eclipse and am an intermediate Java developer.
I have tried everything found several wired tether options none work. I will start with the market pdanet randomly looses connection (if you have the answer please this seems easiest rout) easy tether just plain doesn't work not sure why I think it's cause I am on windows 7 x64. Now I found a couple out of the market that also don't work android-wired-tether - Project Hosting on Google Code not sure how to get it to work and this azilink - Project Hosting on Google Code. This I got as far as trying to load it and I get OpenVPNClient start azilink_p1634: process started and then immediately exited: . I like pdanet but it just keeps dropping connection.
Is anyone able to explain to me exactly what the upcoming JIT compiler will provide? For example, I have Java programs that generate bytecode at runtime which I would like to port to android. Will the JIT compiler make this possible by converting the runtime generated Java byte code to Dalvik at runtime as required?
I just read that Android has a 450% performance improvement because it added a JIT compiler, I know what JIT is, but I don't really understand why is it faster than normal compiled code? or what's the difference with the older approach from the Android platform (the Java like run compiled bytecode).
Is there a way to control the optimization level of the java compiler that Eclipse uses when building a project?Or is this question not relevant anymore, is all optimization deferred to the vm? The results of this tests imples test_f() is not being inlined, even though it really is a prime candidate for it. It should also be possible to do this inlining at compile time.I investigated this further, and it turns out Dalvik doesn't do inlining at this date.
It is clear that cross compilers will not be allowed by the Apple App Store, so a developer will need to be familiar with Objective-C to create applications for the iPhone.I was wondering, is there a cross compiler that will take Objective-C application code and rebuild it into a similar Java application that can be packaged for Android? That way, a developer could still learn just one language (obj-c) but put out applications on many devices.I understand that the Java port would be less optimal than a natively coded application, but could conceivably save a developer some time.
As I've heard from Google IO 2010 session, Dalvik JIT compiler just support ARM processor.Do this mean my own build of Android source on Linux X86 or Mac OS X can not support JIT compiler?Should I use some target board with ARM processor to test Dalvik JIT compiler?
I want to add -Xlint:deprecated to the java compiler while building android app.I've seen the compilerarg tag inside javac tags, but the generated build.xml for the standard project doesn't have such a tag.
Somethings I'll have an? .xml file selected when I compile a project, only to have a? .out.xml generated. Deleting the file doesn't clear the error, and Eclipse won't compile the project. It just reports that your project contains errors. The solution is to go to Project/Clean. This will clear the error in the project and allow it to compile.
I can now get our Android project to talk to our non-Android project. But there's still an issue: I are trying to have an Android class call a non Android Hello World class. I tried compiling our non-Android Hello World class in a separate Eclipse workspace. I then packaged it into a jar. I imported that jar into our Android Hello World class.
I then called one of the methods in the non-Android Hello World class. When I ran the Android Hello World class as an Android application, the following runtime error occurred. Here are the Android debug logs:
08-11 09:07:56.764: ERROR/AndroidRuntime(333): FATAL EXCEPTION: main 08-11 09:07:56.764: ERROR/AndroidRuntime(333): java.lang.ExceptionInInitializerError 08-11 09:07:56.764: ERROR/AndroidRuntime(333): at com.hello2.hello2.onCreate(hello2.java:27) 08-11 09:07:56.764: ERROR/AndroidRuntime(333): at android.app.Instrumentation.callActivityOnCreate(I nstrumentation.java:1047).....................
Say I have an Animal class, which is parcelable, and I have a Dog class and a Cat class, which are subclasses of Animal and also implement Parcelable.
Say I have a service with the following AIDL interface:
Now I'm calling this remote interface from some client application, passing it a List containing Cats and Dogs. What happens now is that android calls the Cat's and the Dog's writeToParcel() methods at the client side, but at the server side, the Animal's CREATOR is used, which calls Animal's readFromParcel() method. So the right data is sent from the client, but the wrong unmarshalling code is executed at the server.
I have tried to put this in the AIDL file:
sendAnimals(List<T extends Animal> animals);
This results in a syntax error from the aidl compiler though.
My current workaround is as follows: - In each specific Animal subtype's writeToParcel() method, I write the class name as a String into the Parcel as the first element. - In the Animal's CREATOR.createFromParcel() I read the first String out of the parcel, and based on that I create the appropriate type and call the appropriate readFromParcel() method.
I think this is kind of ugly though. I would expect the android framework to take care of this for me.
(My application is not actually dealing with animals, this is just to make it simpler to explain the issue)
I have 2 android projects out of which I modified one to work as a library. I want the main project to refer to this library to perform few functions. While this scenario works just as expected, I want to introduce one more functionality. I want to link this library project with another just a java project which has code common to both Android and Blackberry applications. This second part however doesn't seem to work and throws "The application <appname> (<package name>) has stopped unexpectedly. Please try again" with a ForceClose button. I would greatly appreciate if someone can give a brief information on how to make this work.