Writing an android library

Put your problem here if it does not fit any of the other categories.

Writing an android library

Postby LStrike » Fri Jun 25, 2010 10:33 am

Hello there,

its me again with a new question ;)

I want to write a library for android.
I know how to do this for Java. In Android I have to do it similar.

Now here is the question:

I want to use some android classes, for example the smsManager.
If I write a regularly android application my class extends activity.
But I don't need any activities or GUIs, etc.

How can I declare my class, that I can use the smsManager?

Greetings LStrike
FNORD this line does not exist!
-------------------------------------------------
T-Mobile G1 with Cyanogenmod 5.0.8 DS
HTC Desire S with Android 2.3.3
User avatar
LStrike
Junior Developer
Junior Developer
 
Posts: 20
Joined: Mon Feb 22, 2010 2:22 pm
Location: Hamburg, Germany

Top

Re: Writing an android library

Postby padde » Fri Jun 25, 2010 11:10 am

A library in Android (in most cases) is a normal activity. You just declare it differently in the Manifest.
The API is exposed via Intents.

The commonly known radar is a good example.. see source here.

http://code.google.com/p/apps-for-andro ... runk/Radar
padde
Master Developer
Master Developer
 
Posts: 443
Joined: Wed Apr 08, 2009 4:52 pm

Re: Writing an android library

Postby LStrike » Fri Jun 25, 2010 1:03 pm

Thank you.
FNORD this line does not exist!
-------------------------------------------------
T-Mobile G1 with Cyanogenmod 5.0.8 DS
HTC Desire S with Android 2.3.3
User avatar
LStrike
Junior Developer
Junior Developer
 
Posts: 20
Joined: Mon Feb 22, 2010 2:22 pm
Location: Hamburg, Germany

Re: Writing an android library

Postby rciovati » Sat Jun 26, 2010 6:44 pm

I think you can also create a normal Java Library and add a reference to android.jar
rciovati
Developer
Developer
 
Posts: 25
Joined: Mon Jan 04, 2010 12:52 am
Location: Milano (Italy)

Top

Return to Other Coding-Problems

Who is online

Users browsing this forum: No registered users and 20 guests