1
votes

I need to debug my CN1 app on Android. That's why I successfully followed the instructions given in this Codename One tutorial (I copied and updated the gradle files dependencies content as explained).

I am a little bit confused now with the updated sources part.

There is a portion we didn’t get into with the video, copying updated sources directly without sending a build. This is possible if you turn on the new Android Java 8 support. At this point you should be able to remove the libs jar file which contains your compiled data and place your source code directly into the native project for debugging on the device.

If I change things in the native implementation file and if I launch the debug process it seems to work. But do I have to remove the userClasses.jar file from libs directory ? When is this jar file being called actually ?

Furthermore can I also make changes to the CN1 code from Android Studio (eg changes in Main Class) or these need a proper build process on the servers ?

UPDATE November 22nd 2016

In my experience the first time you want to debug your app in Android you need to copy paste your source files AND the userClasses.jar (in libs folder). When you update ONLY the native implementation files you can run a debug without sending a build. But if you change something in the CN1 code it won't be reflected in Android as long as you don't update the userClasses.jar (seems logical since Android does not know anything about CN1).

Any piece of information appreciated,

Cheers,

1

1 Answers

1
votes

The build server doesn't have access to your code, just the jar with bytecode/data files and the user jar is "almost" that jar.

We run some bytecode processing such as retrolambda and other things so it isn't exactly what you compiled when you built the project.

If you copy and paste your source directory into the project you will need to remove that jar so you won't see duplicate classes. You will also need to enable Android Studios Java 8 language support to get that to work.