Create OSGI bundle compatible with android activity

Source: Internet
Author: User

1. Create an android Application normally

2. Set the main application project of the OSGI framework as the reference project of the bundle. In eclipse, go to build path-> configure build path-> projects to set.

3. create and generate manifest. mf. you can use the bndtools plug-in of eclipse or its original version bnd. jar to automatically generate the file (bndtools seems to have a bug, and I cannot use it to generate the correct manifest. mf and jar packages, but bnd. jar can. The command line I used is: java-jar bnd-2.1.0.jar buildx -- classpath bin -- eclipse -- output test. jar bnd. bnd ).

4. Go to android tools> Export unsigned Android package to Export the unsigned android APK file.

5. Use any zip tool such as 7zip to open apk, create a new folder: META-INF, and copy the generated manifest. mf to this folder

6. Upload the java class file generated by the project to the root directory of the apk.

7. Use the java signature tool to sign the APK File

Jarsigner-verbose-keystore/path_to_keystore/mykeystore. keystore my_application.apk my_keystore_alias.

8. Install the apk on emulator or device, and install the OSGI framework to start the bundle.

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.