1

I need to launch an andoird app via codename one. We have already built an app in android. The second app needs to be built in CN1. I need to launch the first app using a button in the second app. I did stumble across NativeInterface, however, did not find any examples to achieve the above.

Also, I need to create a pdf file using CN1. How do I achieve that ?

Any help would be appreciated.

Thanks, Sanket

sanket
  • 789
  • 4
  • 16

2 Answers2

1

Regarding launching an app from a CodenameOne project you can do the following: 1)Use Display.getInstance().extecute(intentUri);

where the intent uri need to comply with the android intent convention it should look something like this: intent:#Intent;action=...

2)Create a NativeInterface then in the android implementation create your intent and execute it.

Regarding pdf generate, there isn't such api in codenameone, personally I would recommend on sending the data to the server and do the generation on the server side.

Chen
  • 3,760
  • 1
  • 17
  • 21
  • Hi Chen, Thanks a lot for the answer. I cannot upload data to the server for PDF generation as I am assuming no internet. The application will be packaged with the device. I am thinking that I can call another application on android that generates the pdf file. What do you think ? – sanket Oct 16 '13 at 14:18
  • There are some 3rd party library that supports this, you will need to add the 3rd party jar in the native/android and create a NativeInterface that wraps the call to the API - for more info how to use such API see this - http://stackoverflow.com/questions/2499960/how-to-create-pdfs-in-android-sdk – Chen Oct 20 '13 at 06:59
0

I can't find the intentUri in Android. How look the intentUri? I would execute Skype if i clilck on a Button but Skype can't be executed.

My Code:

@Override
protected void onKomm_Button2Action(Component c, ActionEvent event) {

    try {
        Display.getInstance().execute("com.skype.raider");
    } catch (Exception e) {
        Dialog.show("Error!", "Failed to start. Skype installed?", "OK", null);
        e.printStackTrace();
    }

}

How should like look my Code?

Thanks.

Ramosta
  • 626
  • 1
  • 7
  • 29