Rajeev
Posts: 0
Joined: Tue Feb 25, 2014 10:01 am

Using Java Classes

Hi,

There are Java classes to perform some funtionality. How do we use these Java classes in Appery.IO applications. Can we import them and use them in Javascripts or we can write these classes some where inside the application?

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

Using Java Classes

Hello!
You can add any Java files on Source tab. If you need to call any functions from these JS files using JS code, you would need to implement them as PhoneGap plugin http://cordova.apache.org/docs/en/3.0...

Rajeev
Posts: 0
Joined: Tue Feb 25, 2014 10:01 am

Using Java Classes

I didn't get the plug-in part. I have a requirement to use below java class for receiving broadcasts. What is the best way to do that in appery.io

Thanks

public class MyReceiver extends BroadcastReceiver {

Code: Select all

 @Override
 public void onReceive(Context arg0, Intent arg1) {
     // TODO Auto-generated method stub

      Log.v("#@%@%#", "Power button is pressed.");  

      Toast.makeText(arg0, "power button clicked",Toast.LENGTH_LONG).show();

     //perform what you want here
 }

}

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

Using Java Classes

Sorry, but we are not aware what is this requirement. You would need to check your requirements carefully and figure out where it's recommended to place the code.

Return to “Issues”