Can a native application use java methods in TelephonyManager using getSystemService()

by Roman ( T-Mobile USA) » Fri, 18 Sep 2009 05:02:51 GMT


Sponsored Links
 JNI is bi-directional. You can alsoo call Java methods from native
code.

I haven't tried this on the Android platform but I assume that it
works fine.


--
Roman Baumgaertner
Sr. SW Engineer-OSDC
T  Mobile stick together
The views, opinions and statements in this email are those of the
author solely in their individual capacity, and do not necessarily
represent those of T-Mobile USA, Inc.



--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. Phone Listner API in Android?

Is  there any API which can listen to the phone states in Android?

I mean when a call is initiated, connected, answeres or disconnected.


--~--~---------~--~----~------------~-------~--~----~

2. problems calling Hessian service with HTTP post

I'm trying to connect to a Spring Hessian service.  I get this error:
"java.net.ProtocolException: Does not support output" when calling
c.getOutputStream().  Should I be using some other HTTP API for this?
Is there any better way to do remote procedure calls with Android?
Thanks for any help!

private String getHello() throws IOException {

                URL url= new 
URL("http://localhost:8069/hm/remoting/ServerService");

                HttpURLConnection c = (HttpURLConnection) url.openConnection();
                OutputStream os = c.getOutputStream();
                MicroHessianOutput out = new MicroHessianOutput(os);

                out.startCall("hello");
                out.writeString("echo");
                out.completeCall();

                os.flush();

                InputStream is = c.getInputStream();

                MicroHessianInput in = new MicroHessianInput(is);
                in.startReply();
                String value = in.readString();
                in.completeReply();
                return value;
}


09-29 15:26:22.332: WARN/System.err(231): java.net.ProtocolException:
Does not support output
09-29 15:26:22.412: WARN/System.err(231):     at
org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:
1078)
09-29 15:26:22.433: WARN/System.err(231):     at
com.hm.hm.getHello(hm.java:94)
09-29 15:26:22.453: WARN/System.err(231):     at
com.hm.hm.onCreate(hm.java:38)
09-29 15:26:22.463: WARN/System.err(231):     at
android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:
1122)
09-29 15:26:22.482: WARN/System.err(231):     at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:
2103)
09-29 15:26:22.493: WARN/System.err(231):     at
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:
2156)
09-29 15:26:22.514: WARN/System.err(231):     at
android.app.ActivityThread.access$1800(ActivityThread.java:112)
09-29 15:26:22.522: WARN/System.err(231):     at
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1580)
09-29 15:26:22.532: WARN/System.err(231):     at
android.os.Handler.dispatchMessage(Handler.java:88)
09-29 15:26:22.542: WARN/System.err(231):     at
android.os.Looper.loop(Looper.java:123)
09-29 15:26:22.542: WARN/System.err(231):     at
android.app.ActivityThread.main(ActivityThread.java:3742)
09-29 15:26:22.553: WARN/System.err(231):     at
java.lang.reflect.Method.invokeNative(Native Method)
09-29 15:26:22.562: WARN/System.err(231):     at
java.lang.reflect.Method.invoke(Method.java:515)
09-29 15:26:22.573: WARN/System.err(231):     at
com.android.internal.os.ZygoteInit
$MethodAndArgsCaller.run(ZygoteInit.java:739)
09-29 15:26:22.583: WARN/System.err(231):     at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:497)
09-29 15:26:22.593: WARN/System.err(231):     at
dalvik.system.NativeStart.main(Native Method)


--~--~---------~--~----~------------~-------~--~----~

3. android classloader won't find my classes

4. WikiNotes & WikiNotes Articles

5. Intermediate server Problem

6. GeoLocation using cellId/Lac

7. one line EditText