Android :: Implement Services Without Using Activities?

Oct 6, 2009

I am presently working on services.I have read many articles related to services.But one thing I don't understand is if we want our application to run in background how can we implement services without using Activities.

Android :: Implement services without using Activities?


Android :: Close All Activities And Services For An App?

Jul 14, 2010

Can any one give me some code to close all the services and activities of my app so they dont reopen? i know in android you dont have to close your app but i want the app to exit if the terms of service are not accepted. at the moment im using android.os.Process.killProcess(android.os.Process.myPid()); in one of my activities but the launch activity automatically starts aggin, any way to prevent this?

View 9 Replies View Related

Android :: Implement ClientLogin To Access Google Services?

Jan 28, 2010

What is a good way to implement the Google ClientLogin scheme below on Android? My understanding is that Android does not support the GData API. So I wanted to say, login to my Google books account, will I be able to do it using Android and the reference above? What classes should I be looking at in the Android SDK? (I am using Android 1.6.)

View 2 Replies View Related

Android :: Sharing Data Amongst Activities And Services

Aug 23, 2010

I am working on a small android project where it is necessary to share some data amongst several activities and a service that runs in a separate process. I would just like to know what are my options in terms of sharing data? Application class? IPC? File-based? Broadcasts?

View 3 Replies View Related

Android :: Using Same Sqlite Database From Multiple Activities And Services

Apr 27, 2010

I have been trying to find a discussion on the best way to handle a common sqlite database which is shared by multiple Activities (or multiple Activities and Services). This is all in the same application.

It seems that if each Activity has:

CODE:.........................

View 14 Replies View Related

Android :: Accessing Shared Preferences In Services And Non Activities

Sep 23, 2009

I have some shared preferences (user_id, email) that I want to access from services and classes that are not subclassed from Activity. I have been trying to implement this today and keep hitting roadblocks. In particular, when I try to access getSharedPreferences, I get a null pointer exception. My code is posted below. My goal here is to allow read access the shared preferences to objects and (potentially) services that aren't going to be directly exposed to the user.

<snip> public class MyPrefs extends Service {
public static final String PREFS_NAME = "MyPrefs";
private int user_id;
private String user_email;
private String user_password;
private Editor editor = null;
private SharedPreferences settings = null;
public MyPrefs () {
settings = this.getSharedPreferences(PREFS_NAME, Context.MODE_PRIVATE);
}
</snip>
this.getSharedPreferences line causes a null pointer exception.

View 3 Replies View Related

Android :: Create Services Without Activities Associated With It As Stand Alone Inside Apk?

Aug 16, 2010

Can a services exists as a stand alone with out any activities/ default. Is it possible to create services with out any activities associated with it as a stand alone inside a apk. (just a service).

View 2 Replies View Related

Android :: Implement Flip Effect Between Activities?

Mar 20, 2009

You've probably seen the effect on the iPhone when you go to the next screen, it flips the screen, making it appear, like you just flipped over a card and a new screen appeared. There is a demo of something similar in the APIDemos (Views/Animation/ 3D Transition), but the transitions are between elements of the same page. Is there a way to implement the flip effect between Activities (in the same process)?

View 4 Replies View Related

Android :: How To Implement Generic Activity - List And Map Activities?

Oct 13, 2010

I want to display the same options menu on all of my application's activities. I created a generic Activity that implements the menu, and all my further activies extend it. The problem: when I need to extend other specific activities, like ListActivity and MapActivity, I can't figure out how to extend the generic activity and add the List or Map behaviour to the new class. To deal with the issue I had to create three different generic activities, each extending Activity, ListActivity and MapActivity.I've tried creating an abstract activity but it doesn't work, I would need to extend two classes at the same time. I could try interfaces but since I can't implement methods, I would have to paste the menu implementation all over the second-level classes, right?

View 1 Replies View Related

Android :: Implement Signature-level Security On Android Services

Sep 21, 2010

I'm developing on an application at the moment which contains quite a lot of personal user information - things like Facebook contacts, etc ... Now, one of the things I want to be able to do (and have done, quite effectively) is open up parts of the application to "3rd Party" applications, using Android's build-in inter-process communication protocol (AIDL). So far so good.Here's the catch: because we're involved in handling quite a lot of personal information, we have to be quite careful about who can and can't access it; specifically, only "Trusted" applications should be able to do so. So the natural way to do this is to use a custom permission within the AndroidManifest.xml file where we declare the services. My problem is this: I want to be able to enact signature-level protection (similar to the normal "signature" permission level), but with a bit of a catch:

I don't only want application signed with our internal signature to be able to access the services. I'd like to be able to build a list of "trusted signatures" & at runtime (or if there's a better way, then maybe some other time?) be able to check incoming requests against this list of trusted keys.This would satisfy the security constraints in the same way as the normal "signature" permission level I think - only programs on the "trusted keys list" would be able to access the services, and keys are hard to spoof (if possible at all?) - but with the added bonus that we wouldn't have to sign every application making use of the APIs with our internal team's key.Is this possible at the moment in Android? And if so, are there any special requirements?

View 1 Replies View Related

Android :: Switching Activities / Passing Data Between Activities

Jun 30, 2010

how to call BarCodeScanner, and return the value to a field.so now, i have a toast that says "successful scan" and then i want to pass the result to a new activity. when i comment out my intent, everything works (minus the passing of data/switching of screen, obviously) but when i run my project as is, it FC's no errors reported by eclipse in code or xml. any insights?

View 2 Replies View Related

Android :: What Are C Based Services And Java Based Services?

Aug 31, 2010

What are C based services and Java based services in Android? What is similarity and dissimilarity between them ? Are C based services available in Android?

View 1 Replies View Related

Android :: Services X Threads

Feb 22, 2010

I'm trying to understand the idea behind the Services. If it runs in the program's thread, why not create just a separate thread (or AsyncTask) to do the job? Can a service keep running in the background? For example, i want to create a task that will continuously be polling data from a server, even if the main application is not running. Can this be achieved with a Service?

View 8 Replies View Related

Android :: How Do Services Communicate With Each Other?

Mar 25, 2009

I am trying to send AT commands via Ril from LocationManager as there is only one AT port I can use. But it seems like that there is no ways to call the function refer to Ril. Can I just new a commandsinterface and to call ril's functions via it?

View 2 Replies View Related

Android :: Listening To Services

May 19, 2009

In my ideal little dream world, I'd like to have a custom service running that handles network comms. Activities (e.g. UIs) then add listeners to it and it provides callbacks when anything interesting happens.

As it stands, I can't see how to do this in an appropriate way. OK, you can call bindService() and have a ServiceConnection implementation that monitors the service state. From there you can easily talk *to* the service whenever you desire, using serialisation over transactions, but I don't think that helps with communication initiated by the service.

The only way I know of doing what I want is by maintaining static collections of listeners on the service class, which doesn't strike me as good engineering.

View 2 Replies View Related

Android :: What Services Are Available At The API Level

Sep 4, 2009

I know about LocationManagerService, AlarmManagerService, and BatteryService, from Android programming books, but is there a published list of all available services?

View 6 Replies View Related

General :: What Are Android Services

Jul 30, 2013

When an app gets permission to access your Google account's Android services exactly what does it have access to? Is it authenticated to access all your google stuff including gmail?

For example, I installed Changelog Droid from the play store and it wants to access my Android services. I understand it probably only needs the permission to access my play store account to analyze my installed apps, but what else is open to it if I give it the permission?

View 2 Replies View Related

Android :: Using New StartForeground Vs Old SetForground For Services

Nov 26, 2009

I have a couple of services in my application which need to be marked as foreground to prevent them from being killed unnecessarily. Currently I am building my application with the 2.0 SDK but I have android:minSdkVersion="3" android:targetSdkVersion="5" in my manifest file so that I can support 1.5, 1.6 or 2.0 devices. I am currently using only the 1.5 APIs so that my application will run correctly on the 1.5 devices.

2.0 introduced a nicer startForground method that combines setting the foreground flag and starting a notification which can be used to control the service. The 2.0 documentation says that startForground replaces setForeground, and that due to the fact that many applications were mistakenly using setForeground without a notification that could be used to control and close down the service, that the older setForeground method had been changed so it no longer does anything on 2.0. I tried using the newer 2.0 interface but it caused an exception for phones running 1.5 or 1.6. So I am still using the older setForeground interface and calling notify separately. But it appears that since I am building with the 2.0 SDK the older interface isn't really preventing my services from being killed.

View 4 Replies View Related

Android :: Use Alert Dialog In Services

Oct 19, 2010

i want to use alert dialog in services, but i'm not getting the dialog,

public void myEventOccurred(Event evt) { // TODO Auto-generated method stub System.out.print(">>>>><<<<<< Event fired..."); new AlertDialog.Builder( this ) .setTitle( R.string.SaveConnectionChangeWarningTitle ) .setMessage( "Alert !" ) .setPositiveButton( android.R.string.ok, new DialogInterface.OnClickListener() { public void onClick( DialogInterface dialog, int whichButton) { dialog.dismiss(); } }) .show();

}

View 6 Replies View Related

Android :: Stop Other Services In API 8 (Froyo 2.2)

Jun 12, 2010

I know of the wonderful change from 2.1 to 2.2 that ActivityManager.restartPackage now doesn't do the dirty stuff anymore since it now calls killBackgroundProcesses. Nice on one side, but bad on the other side. Because of that Services are not killed anymore.See as well: http://groups.google.com/group/android-developers/browse_thread/threa.I am the developer of SleepTimer in the Android market and used restartPackage to stop Music Players to play music. I therefore killed the services. That worked well. But now with killBackgroundProcesses it doesn't work anymore. I added the new Permission to my manifest, but still the music remains running. Yes i know that google kind of wants that. But it breaks the possibility to stop the different music players from my app. Now my question: Is there another way to kill/stop other services (music player services) in API 8?

View 2 Replies View Related

Android :: Errors On Calling Web Services

Aug 8, 2009

When i am calling the web services i got his errors. i added the internet permissions in android manifest.xml file 08-08 15:40:09.127: INFO/aSizzle(198): statusCode>>>500 08-08 15:40:09.158: INFO/aSizzle(198): statusLine>>>HTTP/1.1 500 Internal Server Error

View 2 Replies View Related

Android :: Starting And Stopping Services

Aug 14, 2010

I have a service running (Socket), this is how i start the service.

CODE:.......

But this doesn't seem to stop my service? Am i missing something? I need to destroy my service as soon as the home button is clicked.

View 1 Replies View Related

Android :: Enabling And Disabling Services

Jul 6, 2010

I am new to Android development and have trouble enabling / disabling the wifi & audio services. I get the appropriate manager instance using the getSystemService method. But I don't get any error when enabling wifi using:

wifiMgr.setWifiEnabled(true);

But the wifi is simply not turned on! Similarly I use

mAudio.setRingerMode(AudioManager.RINGER_MODE_SILENT);
or
mAudio.setRingerMode(AudioManager.RINGER_MODE_NORMAL);.....................

View 1 Replies View Related

Android :: Debugging Geo Locations Services

Jan 20, 2009

I wrote some reverse geocoding, geolocation and proximity alert routines for my little Android app. I took my Android out with me when running errands to test my routines; they're kinda hard to test from my couch. Half of them didn't work. What's the best way to debug something like this? Sprinkle a bunch of printf statements (or whatever you call them in Java) throughout the app? Log everything to the sdcard? Write a toggleable view (is that even possible?) that acts as a console? Faber Fedor Cloud Computing New Jersey http://cloudcomputingnj.com

View 6 Replies View Related

Android :: Background Running Services

Aug 31, 2010

The only thing i have running on my phone right now is the touch input. is this something that runs constantly? ive tried going fully through the setup again and its still there. anyone know how to end it so its not running all the time?

View 1 Replies View Related

Android :: Locate Services Offered?

May 13, 2010

What are the types of locating services offered by android? Does it offer GPS, cell-site/geolocation and WiFi? Can a developer choose which service to use or does the android choose?

View 2 Replies View Related

Android :: Code For XMPP Services

Nov 18, 2009

I went through the Android introduction videos and in them an engineer from Google spoke of an open XMPP/gtalk service provided by Android, that developers could use to push messages out from a server to Android devices. I googled the forums and dug through the SDK samples, but could not find any code for these XMPP services. Also my search results only returned entries logged in the Jan 2008 time frame an earlier (I found this to be somewhat odd). Anyway, there was mention of a SMACK API that handles xmpp messaging, but I'm assuming that android has their own libraries for this.

View 3 Replies View Related

Android :: How Binding To Services Works

Jul 2, 2010

I'm a little confused on how binding to services works. I understand using Context.startService() starts the service and that bindService doesn't call onStartCommand. But my understanding is that if I use startService, I have to explicitly stop the service. But I want the service to die if there are no more activities bound to it.My problem is that calling bindService never calls onServiceConnected(), so my Service binder object is null. Does the service have to be explicitly started in order to bind to it? If so, how does it know to terminate when nothing is binding to it anymore, and how do I know if it's started so I can know to use the bound object?

View 3 Replies View Related

Android :: Wake Locks And Services

Jun 13, 2009

I need to use a wakelock to hold the screen active while its required. I was recommended to use a service which I have been trying but on the onDestroy I am getting "wl cannot be resolved".

Code below:

CODE:...............

View 9 Replies View Related

Android :: KSoap2 Or RESTful Web Services?

Sep 27, 2010

What is the best way to deal with web services in Android? I have been looking at KSoap2 library and RESTful web services.

I got one working with KSoap2, but only when the web service is on a remote server, not on localhost. I have tried to redirect the ports for incoming and outgoing as it says on the android dev site, i have used the ip of the network i am on, my own ip and the localhost-ip (it says on the site that one cannot use localhost cause that is the emulators own loop-back network. None works.

With RESTful webservices, i have only tried a tutorial where a google app engine is used as server if i understood it right. Is it easy to connect a RESTful web service to a database. I need to have a database connection in my applikation, which one is normally used with REST?

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved