Reputation: 789
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
Upvotes: 1
Views: 643
Reputation: 647
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.
Upvotes: 0
Reputation: 3760
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.
Upvotes: 1