You can create a ContentProvider for this:

http://developer.android.com/intl/fr/guide/topics/providers/content-providers.html

A tutorial can be found here:

http://www.devx.com/wireless/Article/41133

It will provide a interface to your database, that can be shared
between applications.


On Tue, Jan 5, 2010 at 2:57 PM, pentium10 <[email protected]> wrote:
> So I need a service and an activity.
>
> How are you handling the database across two different app (i mean
> shared) ?
> how can I create a single database class and use that for db
> interactions all over my apps/services ?
>
> On Jan 5, 4:50 pm, Justin Anderson <[email protected]> wrote:
>> AFAIK, it is not possible to undermine the Android OS and prevent your
>> program from being closed down if memory gets low.
>>
>> However, to run in the background you would want to take a look at
>> Services.  To launch an activity from a service you would use the
>> startActivity() method.  As for being notified when certain things occur,
>> you would want to take a look at BroadcastReceiver class.
>>
>> Hope that helps you get started in the right direction.  A word to the wise
>> though, provide an option to turn off the background stuff... users get
>> really upset if they can't control stuff like whether an app runs in the
>> background.
>>
>> I have an app, called AppSwipe, that will tell you which programs are
>> running in the background and will let you close them.  I routinely check it
>> and close apps that I don't want running and wasting my battery life.  And
>> if an app gets too annoying with restarting itself after I close it, I
>> uninstall it.... no matter how useful or cool it is.
>>
>> Thanks,
>> Justin
>> MagouyaWare
>>
>> ----------------------------------------------------------------------
>> There are only 10 types of people in the world...
>> Those who know binary and those who don't.
>> ----------------------------------------------------------------------
>>
>>
>>
>> On Tue, Jan 5, 2010 at 2:50 AM, pentium10 <[email protected]> wrote:
>> > Hello,
>>
>> > I am new to Android, and I need some advices for start up.
>> > I want to build an application, which will show up, when the user gets
>> > into some hot situation.
>> > By hot situation I mean:
>> > * his GPS/cell coordinates are in known zone;
>> > * known Bluetooth device detected;
>> > * known Wi-Fi network detected;
>> > * weather info has change;
>>
>> > I see something running in background and when one of the clauses hit,
>> > it will trigger and open the app.
>> > * How to get started?
>> > * How do I make sure my app won't be shut down?
>> > As I read somewhere that Android OS will terminate apps if memory out
>> > occurs or consumes too much, and my app would consume a lot, making
>> > repeated measures/checks to see if situation changed.
>>
>> > Regards,
>> > Pentium10
>>
>> > --
>> > You received this message because you are subscribed to the Google
>> > Groups "Android Beginners" group.
>>
>> > NEW! Try asking and tagging your question on Stack Overflow at
>> >http://stackoverflow.com/questions/tagged/android
>>
>> > To unsubscribe from this group, send email to
>> > [email protected]<android-beginners%2Bunsubscr
>> >  [email protected]>
>> > For more options, visit this group at
>> >http://groups.google.com/group/android-beginners?hl=en
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Beginners" group.
>
> NEW! Try asking and tagging your question on Stack Overflow at
> http://stackoverflow.com/questions/tagged/android
>
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/android-beginners?hl=en
>
-- 
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en

Reply via email to