Dianne, OK, I've read up on the PlatformLibrary and using that and SimpleJNI as examples, I've converted our code to a similiar scheme. I created a new directory that contains the Java and Jni directories and the appropriate files in those directories. I configured the Android.mk files to both create the shared library and the JAR file.
When I build Android, I can see that my .so file gets built and deploy into /system/lib and the .jar file gets built and deployed into /system/framework. However, the contents of the .jar file is a Classes.dex file rather than the new class I defined and it's public methods like is visible within Eclipse inside android.jar. When I look at the target/common/obj/JAVA_LIBRARIES/com.example.android.test/ directory, I see a classes.jar file and in that is .class file that seems to have what I need, but that doesn't get compiled into the DEX file properly..what's the right thing to do to get the last piece working?? Regards -- Ashwin On Tue, Mar 9, 2010 at 7:57 PM, Dianne Hackborn <[email protected]> wrote: > We very strongly recommend adding custom APIs through a separate shared > library, as shown in the PlatformLibrary sample, rather than modifying the > framework library. This will make things a lot easier for you (easier to > maintain patches or even no patches at all, works well with SDK tools), and > ensures that apps correctly report the special APIs they need (via > uses-library) so that the system and market can know whether they are > compatible with the device they are being installed on. > > On Tue, Mar 9, 2010 at 7:53 AM, Ashwin Bihari <[email protected]> wrote: >> >> Guys, >> >> I've got a similar question in line of adding new APIs that I need to >> deploy for application developers, and wonder what's the best way to >> do it. >> >> We are delivering a platform to our customer's apps team and as part >> of the platform we need to add some custom APIs to access specific >> hardware resources, these are currently implemented through JNI and >> have associated JAR files. The test applications directly link in >> these JAR files to make use of the new APIs, but I'm wondering what's >> a better way of deploying these new APIs without having developers >> specifically including JAR files?? >> >> Deva, could you elaborate a little more about the dalvik executable >> and how that works, thanks >> >> Regards >> -- Ashwin >> >> >> >> On Tue, Mar 9, 2010 at 9:58 AM, Deva R <[email protected]> wrote: >> > hi, >> > as this's regarding android app development, you might get fast response >> > at >> > 'android-developers' >> > >> > here's my 2 pennies: >> > - if you want to create a new app, use SDK,and compile your .java source >> > to >> > dalvik executable. (.dex) >> > note android has dalvik VM, so, regular .class wont be supported. >> > >> > - if you want to modify exisiting android component, download complete >> > android filesystem source, modify, rebuild the component and use. >> > >> > >> > On Tue, Mar 9, 2010 at 12:26 PM, Anandi <[email protected]> wrote: >> >> >> >> Hi all, >> >> >> >> I want to add one sample api in local copy of android on my machine. I >> >> don't want it to be distributed on the open source. >> >> >> >> For eg : I have mathlib.java file . This mathlib class has a native >> >> method add. >> >> >> >> Now i am not able to understand, where in the directory structure >> >> should i keep this java file. >> >> >> >> do i need to create .class and .h files manually for this or will >> >> build system take care of it? >> >> >> >> as per my understanding i'll need to have corresponding cpp >> >> implementation for this api. so, where do i keep this cpp file? >> >> >> >> Please suggest the steps to do this. Thanks in advance. >> >> >> >> Anu >> >> >> >> -- >> >> unsubscribe: [email protected] >> >> website: http://groups.google.com/group/android-porting >> > >> > -- >> > unsubscribe: [email protected] >> > website: http://groups.google.com/group/android-porting >> > >> >> -- >> unsubscribe: [email protected] >> website: http://groups.google.com/group/android-porting > > > > -- > Dianne Hackborn > Android framework engineer > [email protected] > > Note: please don't send private questions to me, as I don't have time to > provide private support, and so won't reply to such e-mails. All such > questions should be posted on public forums, where I and others can see and > answer them. > > -- unsubscribe: [email protected] website: http://groups.google.com/group/android-porting To unsubscribe from this group, send email to android-porting+unsubscribegooglegroups.com or reply to this email with the words "REMOVE ME" as the subject.
