Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android library manifest

I'm developing an application for Android 2.2.

I want to move two packages to an Android library to reuse it. These two packages only contains classes, and the library will only contain classes.

These classes will use GPS, Acelerometer, compass and Orientation sensor.

My problem is with AndroidManifest.xml. I don't know to set it up.

Reading Android documentation, I found this: A library project's manifest file must declare all of the shared components that it includes, just as would a standard Android application.

What are these shared components? Have I to declare all classes?

like image 977
VansFannel Avatar asked Feb 25 '26 00:02

VansFannel


1 Answers

The shared components in this case would be the permissions that are required to use the classes. You need to request permission in the Manifest to use the GPS, Accelerometer, compass, and orientation sensor. Other than that, you shouldn't have to declare anything and you can use the classes just like any other Java class. If they contained Activities, Services, Broadcast Receivers, or sent Broadcasts, you would have to mention those in the Manifest as well.

like image 121
DeeV Avatar answered Feb 27 '26 13:02

DeeV



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!