[android-developers] Can I launch executable file under Jni level?
I write some code by c language and build it for arm platform - imx51. I can run this file under command line like this. start machine. adb push ./hello / adb shell ./hello and I can see the following information Hello World! I write some code on JNI. #include #include #include #include JNIEXPORT void JNICALL Java_rtk_main_atp_BrakeDetect_RunJniBrakeDetect(JNIEnv *env, jobject jobj) { int ret = execv("/hello", (char *)NULL); char buff[100]; memset(buff, 0, sizeof(100)); sprintf(buff, "[libhello] Hello %d \n", ret ); LOGD( buff ); } but it must have something wrong, because I can't get any result from logcat. I got follow message AndroidRuntime( 2688): D/AndroidRuntime( 2688): >> AndroidRuntime START << D/AndroidRuntime( 2688): CheckJNI is OFF D/dalvikvm( 2688): creating instr width table D/AndroidRuntime( 2688): --- registering native functions --- I/ActivityManager( 2136): Start proc com.android.defcontainer for service com.android.defcontainer/.DefaultContainerService: pid=2696 uid=10013 gids={1015, 2001} D/dalvikvm( 2696): GC_EXPLICIT freed 742 objects / 54664 bytes in 53ms D/PackageParser( 2136): Scanning package: /data/app/vmdl13306.tmp D/dalvikvm( 2136): GC_FOR_MALLOC freed 6299 objects / 286008 bytes in 105ms I/PackageManager( 2136): Removing non-system package:rtk.main.atp I/ActivityManager( 2136): Force stopping package rtk.main.atp uid=10034 D/dalvikvm( 2136): GC_FOR_MALLOC freed 1619 objects / 115552 bytes in 104ms D/PackageManager( 2136): Scanning package rtk.main.atp I/PackageManager( 2136): /data/app/rtk.main.atp-2.apk changed; unpacking I/PackageManager( 2136): Package rtk.main.atp codePath changed from / data/app/rtk.main.atp-1.apk to /data/app/rtk.main.atp-2.apk; Retaining data and using new D/installd( 2069): DexInv: --- BEGIN '/data/app/rtk.main.atp-2.apk' --- D/dalvikvm( 2718): creating instr width table D/dalvikvm( 2718): DexOpt: load 14ms, verify 6ms, opt 0ms D/installd( 2069): DexInv: --- END '/data/app/ rtk.main.atp-2.apk' (success) --- D/PackageManager( 2136): Activities: rtk.main.atp.BrakeDetect I/ActivityManager( 2136): Force stopping package rtk.main.atp uid=10034 W/PackageManager( 2136): Code path for pkg : rtk.main.atp changing from /data/app/rtk.main.atp-1.apk to /data/app/rtk.main.atp-2.apk W/PackageManager( 2136): Resource path for pkg : rtk.main.atp changing from /data/app/rtk.main.atp-1.apk to /data/app/rtk.main.atp-2.apk D/dalvikvm( 2136): GC_FOR_MALLOC freed 1695 objects / 115832 bytes in 96ms I/installd( 2069): move /data/dalvik-cache/ d...@app@rtk.main.atp-2@classes.dex -> /data/dalvik-cache/ d...@app@rtk.main.atp-2@classes.dex D/PackageManager( 2136): New package installed in /data/app/ rtk.main.atp-2.apk D/dalvikvm( 2136): GC_FOR_MALLOC freed 1253 objects / 92008 bytes in 100ms I/ActivityManager( 2136): Force stopping package rtk.main.atp uid=10034 D/dalvikvm( 2296): GC_EXPLICIT freed 3866 objects / 240360 bytes in 104ms W/RecognitionManagerService( 2136): no available voice recognition services found D/dalvikvm( 2136): GC_FOR_MALLOC freed 1961 objects / 121864 bytes in 117ms I/ActivityManager( 2136): Start proc com.svox.pico for broadcast com.svox.pico/.VoiceDataInstallerReceiver: pid=2720 uid=10014 gids={} D/dalvikvm( 2136): GC_EXPLICIT freed 412 objects / 21232 bytes in 81ms I/ActivityThread( 2720): Publishing provider com.svox.pico.providers.SettingsProvider: com.svox.pico.providers.SettingsProvider I/installd( 2069): unlink /data/dalvik-cache/ d...@app@rtk.main.atp-1@classes.dex D/AndroidRuntime( 2688): Shutting down VM D/jdwp( 2688): Got wake-up signal, bailing out of select D/dalvikvm( 2688): Debugger has detached; object registry had 1 entries D/AndroidRuntime( 2731): D/AndroidRuntime( 2731): >> AndroidRuntime START << D/AndroidRuntime( 2731): CheckJNI is OFF D/dalvikvm( 2731): creating instr width table D/AndroidRuntime( 2731): --- registering native functions --- I/ActivityManager( 2136): Starting activity: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x1000 cmp=rtk.main.atp/.BrakeDetect } D/AndroidRuntime( 2731): Shutting down VM D/jdwp( 2731): Got wake-up signal, bailing out of select D/dalvikvm( 2731): Debugger has detached; object registry had 1 entries I/ActivityManager( 2136): Start proc rtk.main.atp for activity rtk.main.atp/.BrakeDetect: pid=2749 uid=10034 gids={} D/dalvikvm( 2749): No JNI_OnLoad found in /system/lib/ libBrakeDetect.so 0x46123a68, skipping init I/ActivityManager( 2136): Process rtk.main.atp (pid 2749) has died. I/ActivityManager( 2136): Displayed activity android/ com.android.internal.app.ResolverA after I modify some code under JNI #include #include #include #include JNIEXPORT void JNICALL Java_rtk_main_atp_BrakeDetect_RunJniBrakeDetect(JNIEnv *env, jobject jobj) { int ret = 55;//execv("/hello", (char *)NULL); //fail char buff[100]; mem
[android-developers] Re: How to redirect GPS nmea from /dev/ttymxc to somewhere
Here is the solution about the GpsStatus and GpsSvStatus that I fixed the original problem. http://nelsonchunglife.blogspot.com/2010/12/android-gps-porting-hal-code-fix.html On 12月27日, 上午11時04分, nelsonchung wrote: > Hi all, > > I found that I need to implement other functions follow by gps.h in > order to see the information of gps nmea. > > Here is the solution I described on my blog about how to fix gps nmea > issue.http://nelsonchunglife.blogspot.com/2010/12/android-gps-porting-hal-c... > > Please let me know if you have any question. > > On 12月24日, 下午5時12分, nelsonchung wrote: > > > > > > > > > Dear Anil, > >http://nelsonchunglife.blogspot.com/2010/12/android-gps-porting-hal-c... > > I follow your comment to implement HAL. > > > AP - LocationManager can read Location information now. > > > Very appreciate for you help. > > > I have another problem. > > > How can I let GpsStatus.Listener() and GpsStatus.NmeaListener() work > > fine? > > > I think I must implement something in HAL too, but I have no idea > > about this. > > > In HAL, I implement the following function. > > > nmea_reader_init > > nmea_reader_set_callback > > nmea_reader_update_time > > nmea_reader_update_date > > nmea_reader_update_latlong > > nmea_reader_update_altitude > > nmea_reader_update_bearing > > nmea_reader_update_speed > > nmea_reader_parse > > > What else function should I implement? > > > Very appreciate for any help or comment. > > > On 12月13日, 下午3時00分, Anil Sasidharan wrote: > > > > Hi, > > > > You need to implement gps HAL to hook this data up into Android's > > > LocationService JNI. > > > > Warm Regards, > > > Anil > > > > On Mon, Dec 13, 2010 at 12:27 PM, nelsonchung > > > wrote: > > > > > I can read gps nmea from /dev/ttymxc1 under linux shell command mode > > > > like this - cat < /dev/ttymxc1. > > > > But, I want to know how/where to set in order to let AP level > > > > application - LocationManager can get gps nmea via JNI/Android. > > > > How/Where should I set? > > > > Should I implement some codes followed gps.h? > > > > Or Can I redirect the nmea from /dev/ttymxc1 to somewhere? > > > > > -- > > > > You received this message because you are subscribed to the Google > > > > Groups "Android Developers" group. > > > > To post to this group, send email to android-developers@googlegroups.com > > > > To unsubscribe from this group, send email to > > > > android-developers+unsubscr...@googlegroups.com > > > cr...@googlegroups.com> > > > > For more options, visit this group at > > > >http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Do GPS_EVENT_SATELLITE_STATUS and GPS_STATUS_SESSION_BEGIN have any relationship?
In AP level, I try to use gpsListener = new GpsStatus.Listener() to get event from android jni. and expect to get event - GPS_EVENT_SATELLITE_STATUS to update the gps status. In HAL level, I try to set GPS_STATUS_SESSION_BEGIN to alert AP to update gps status by callback function. It can't be workable. Do they have any relationship or I need to implement by another way? Here is the solution that I can let AP level read nmea, but not gps status. http://nelsonchunglife.blogspot.com/2010/12/android-gps-porting-hal-code-try-to-fix.html Very appreciate for any comments. -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: How to redirect GPS nmea from /dev/ttymxc to somewhere
Hi all, I found that I need to implement other functions follow by gps.h in order to see the information of gps nmea. Here is the solution I described on my blog about how to fix gps nmea issue. http://nelsonchunglife.blogspot.com/2010/12/android-gps-porting-hal-code-try-to-fix.html Please let me know if you have any question. On 12月24日, 下午5時12分, nelsonchung wrote: > Dear Anil, > http://nelsonchunglife.blogspot.com/2010/12/android-gps-porting-hal-code-try-to-fix.html > I follow your comment to implement HAL. > > AP - LocationManager can read Location information now. > > Very appreciate for you help. > > I have another problem. > > How can I let GpsStatus.Listener() and GpsStatus.NmeaListener() work > fine? > > I think I must implement something in HAL too, but I have no idea > about this. > > In HAL, I implement the following function. > > nmea_reader_init > nmea_reader_set_callback > nmea_reader_update_time > nmea_reader_update_date > nmea_reader_update_latlong > nmea_reader_update_altitude > nmea_reader_update_bearing > nmea_reader_update_speed > nmea_reader_parse > > What else function should I implement? > > Very appreciate for any help or comment. > > On 12月13日, 下午3時00分, Anil Sasidharan wrote: > > > > > > > > > Hi, > > > You need to implement gps HAL to hook this data up into Android's > > LocationService JNI. > > > Warm Regards, > > Anil > > > On Mon, Dec 13, 2010 at 12:27 PM, nelsonchung > > wrote: > > > > I can read gps nmea from /dev/ttymxc1 under linux shell command mode > > > like this - cat < /dev/ttymxc1. > > > But, I want to know how/where to set in order to let AP level > > > application - LocationManager can get gps nmea via JNI/Android. > > > How/Where should I set? > > > Should I implement some codes followed gps.h? > > > Or Can I redirect the nmea from /dev/ttymxc1 to somewhere? > > > > -- > > > You received this message because you are subscribed to the Google > > > Groups "Android Developers" group. > > > To post to this group, send email to android-developers@googlegroups.com > > > To unsubscribe from this group, send email to > > > android-developers+unsubscr...@googlegroups.com > > cr...@googlegroups.com> > > > For more options, visit this group at > > >http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: How to redirect GPS nmea from /dev/ttymxc to somewhere
Dear Anil, I follow your comment to implement HAL. AP - LocationManager can read Location information now. Very appreciate for you help. I have another problem. How can I let GpsStatus.Listener() and GpsStatus.NmeaListener() work fine? I think I must implement something in HAL too, but I have no idea about this. In HAL, I implement the following function. nmea_reader_init nmea_reader_set_callback nmea_reader_update_time nmea_reader_update_date nmea_reader_update_latlong nmea_reader_update_altitude nmea_reader_update_bearing nmea_reader_update_speed nmea_reader_parse What else function should I implement? Very appreciate for any help or comment. On 12月13日, 下午3時00分, Anil Sasidharan wrote: > Hi, > > You need to implement gps HAL to hook this data up into Android's > LocationService JNI. > > Warm Regards, > Anil > > On Mon, Dec 13, 2010 at 12:27 PM, nelsonchung wrote: > > > > > > > > > I can read gps nmea from /dev/ttymxc1 under linux shell command mode > > like this - cat < /dev/ttymxc1. > > But, I want to know how/where to set in order to let AP level > > application - LocationManager can get gps nmea via JNI/Android. > > How/Where should I set? > > Should I implement some codes followed gps.h? > > Or Can I redirect the nmea from /dev/ttymxc1 to somewhere? > > > -- > > You received this message because you are subscribed to the Google > > Groups "Android Developers" group. > > To post to this group, send email to android-developers@googlegroups.com > > To unsubscribe from this group, send email to > > android-developers+unsubscr...@googlegroups.com > cr...@googlegroups.com> > > For more options, visit this group at > >http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: How to redirect GPS nmea from /dev/ttymxc to somewhere
Dear Anil, Thanks. Study releated topic. On 12月13日, 下午3時00分, Anil Sasidharan wrote: > Hi, > > You need to implement gps HAL to hook this data up into Android's > LocationService JNI. > > Warm Regards, > Anil > > On Mon, Dec 13, 2010 at 12:27 PM, nelsonchung wrote: > > > > > > > > > I can read gps nmea from /dev/ttymxc1 under linux shell command mode > > like this - cat < /dev/ttymxc1. > > But, I want to know how/where to set in order to let AP level > > application - LocationManager can get gps nmea via JNI/Android. > > How/Where should I set? > > Should I implement some codes followed gps.h? > > Or Can I redirect the nmea from /dev/ttymxc1 to somewhere? > > > -- > > You received this message because you are subscribed to the Google > > Groups "Android Developers" group. > > To post to this group, send email to android-developers@googlegroups.com > > To unsubscribe from this group, send email to > > android-developers+unsubscr...@googlegroups.com > cr...@googlegroups.com> > > For more options, visit this group at > >http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: How to redirect GPS nmea from /dev/ttymxc to somewhere
test reply. On 12月13日, 下午2時57分, nelsonchung wrote: > I can read gps nmea from /dev/ttymxc1 under linux shell command mode > like this - cat < /dev/ttymxc1. > But, I want to know how/where to set in order to let AP level > application - LocationManager can get gps nmea via JNI/Android. > How/Where should I set? > Should I implement some codes followed gps.h? > Or Can I redirect the nmea from /dev/ttymxc1 to somewhere? -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: How to redirect GPS nmea from /dev/ttymxc to somewhere
test reply. On 12月13日, 下午2時57分, nelsonchung wrote: > I can read gps nmea from /dev/ttymxc1 under linux shell command mode > like this - cat < /dev/ttymxc1. > But, I want to know how/where to set in order to let AP level > application - LocationManager can get gps nmea via JNI/Android. > How/Where should I set? > Should I implement some codes followed gps.h? > Or Can I redirect the nmea from /dev/ttymxc1 to somewhere? -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] How to redirect GPS nmea from /dev/ttymxc to somewhere
I can read gps nmea from /dev/ttymxc1 under linux shell command mode like this - cat < /dev/ttymxc1. But, I want to know how/where to set in order to let AP level application - LocationManager can get gps nmea via JNI/Android. How/Where should I set? Should I implement some codes followed gps.h? Or Can I redirect the nmea from /dev/ttymxc1 to somewhere? -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: External keyboard possible?
It is a good idea. I think bluetooth HID profile make the idea true. I think we can use bluetooth keyboard cowork with android device. But, I am not sure the SDK is supported or not. On 11月25日, 上午3時06分, jerome wrote: > Has anyone put any thought into doing an external keyboard? It sure > would be nice to have a real keyboard sometimes. -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en