|
package com.srplab.examples;
import android.app.Activity;
import android.os.Bundle;
import com.srplab.www.starcore.*;
public class TestActivity extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
StarCoreFactoryPath.StarCoreCoreLibraryPath = "/data/data/"+ getPackageName()+"/lib";
StarCoreFactoryPath.StarCoreShareLibraryPath = "/data/data/"+getPackageName()+"/lib";
final StarCoreFactory starcore= StarCoreFactory.GetFactory();
StarServiceClass Service=starcore._InitSimple("test","123",0,0);
StarSrvGroupClass SrvGroup = (StarSrvGroupClass)Service._Get("_ServiceGroup");
Service._CheckPassword(false);
starcore._RegMsgCallBack_P(new StarMsgCallBackInterface(){
public Object Invoke(int arg0, int arg1, Object arg2, Object arg3) {
// TODO Auto-generated method stub
if( arg0 == starcore._Getint("MSG_VSDISPMSG") ||
arg0 == starcore._Getint("MSG_VSDISPLUAMSG") ||
arg0 == starcore._Getint("MSG_DISPMSG") ||
arg0 == starcore._Getint("MSG_DISPLUAMSG") )
System.out.println("....."+arg2); /*--capture information from c */
return null;
}
});
Object[] Result = Service._DoFile("", "/data/data/"+ getPackageName()+"/lib/libtest_c.so","");
if( Result[0] == (Boolean)false )
System.out.println("execute c shared library false");
else
System.out.println("execute c shared library true");
StarObjectClass mainobject = (StarObjectClass)Service._Get("mainobject");
boolean initresult = mainobject._Callbool("Init", this);
if( initresult == false )
System.out.println("init false..............");
else
System.out.println("init true..............");
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.