avoid splash screen if a service is running...

by sdphil » Thu, 10 Sep 2009 07:09:23 GMT


Sponsored Links
 when my activity gets started, i want to check for a service, if it
exists, I want to show screen 2 and bind to the service, if the
service is not running, I want to show screen 1 and start the service.

i could not find an easy way to know whether the service is running or
not...

tia.
--~--~---------~--~----~------------~-------~--~----~



avoid splash screen if a service is running...

by sdphil » Thu, 10 Sep 2009 07:11:30 GMT


 hm...  this is pretty good --
 http://stackoverflow.com/questions/600207/android-check-if-a-service-is-running 

any objections?



--~--~---------~--~----~------------~-------~--~----~


Sponsored Links


Other Threads

1. How to configure TCP/IP MONITOR

Can anyone help me to configure Tcp/ip monitor on eclipse.
I'm writing a client for a Web Server running on remote machine.This
is my code:


import org.ksoap2.SoapEnvelope;
import org.ksoap2.serialization.PropertyInfo;
import org.ksoap2.serialization.SoapObject;
import org.ksoap2.serialization.SoapPrimitive;
import org.ksoap2.serialization.SoapSerializationEnvelope;
import org.ksoap2.transport.AndroidHttpTransport;
import org.ksoap2.transport.HttpTransportSE;
import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
import android.widget.TextView;

public class SOAP2 extends Activity {



    private static String SOAP_ACTION = "http://session/
getAllPositions";
    private static String METHOD_NAME = "getAllPositions";
    private static String NAMESPACE = "http://session/";
    private static String URL ="http://192.41.218.56:8080/WSGeoEAR-
WSGeoServer/NavFinderBean?WSDL";

   TextView tv;
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle icicle) {
        super.onCreate(icicle);
        setContentView(R.layout.main);
        tv=(TextView)findViewById(R.id.result);
        try {

       Log.i("Invio request","1");
      //Chiamo il Metodo del WebServer
       SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);

        Log.i("PROPERTYINFO","2");
     PropertyInfo propertyInfo=new PropertyInfo();
          propertyInfo.name = "arg0";
          propertyInfo.setValue(1);
          propertyInfo.type = propertyInfo.INTEGER_CLASS;
          request.addProperty(propertyInfo);

          /*propertyInfo.setName("idUtente");
          propertyInfo.setValue(1);
          propertyInfo.setNamespace(NAMESPACE);

          request.addProperty(propertyInfo);
      */

          Log.i("Aggiunte le propriet alla request","3");
                SoapSerializationEnvelope envelope = new
SoapSerializationEnvelope(SoapEnvelope.VER11);
        envelope.dotNet = true;
        envelope.setOutputSoapObject(request);

        Log.i("ENVELOPE SETTATA","4");

        HttpTransportSE androidHttpTransport = new
HttpTransportSE(URL);
        Log.i("TRasport url","5");
        androidHttpTransport.call(SOAP_ACTION, envelope);
         Log.i("Envelope inviata","6");
        //Prende la risposta SOAP e ne estrae il corpo

     SoapObject resultsRequestSOAP =  (SoapObject) envelope.bodyIn;
            Log.i("Ricevuta risposta","7");

 String res = resultsRequestSOAP.toString();
  Log.i("Metto la risposta nella var res","8");
  ((TextView)findViewById(R.id.lblStatus)).setText(res.toString()
                );

 
((TextView)findViewById(R.id.lblStatus)).setText(resultsRequestSOAP.toString());


  Log.i("STAMPO A VIDEO","9");
           }catch(Exception E) {
        ((TextView)findViewById(R.id.lblStatus)).setText("ERROR:" +
E.getClass().getName() + ": " + E.getMessage());
            Log.i("Stampo errore","9");
          }
        }
I've Tomcat ho run on localhost:8080,How can I configure Tcp/ip
Monitor??

Thanks in advance

-- 

2. how to remove LogCat error

03-16 22:30:36.516: WARN/Zygote(33): Preloaded drawable resource
#0x10801fb (res/drawable-mdpi/jog_tab_left_confirm_gray.png) that
varies with configuration!!
03-16 22:30:36.546: WARN/Zygote(33): Preloaded drawable resource
#0x1080200 (res/drawable-mdpi/jog_tab_left_normal.png) that varies
with configuration!!
03-16 22:30:36.565: WARN/Zygote(33): Preloaded drawable resource
#0x1080201 (res/drawable-mdpi/jog_tab_left_pressed.png) that varies
with configuration!!
03-16 22:30:36.586: WARN/Zygote(33): Preloaded drawable resource
#0x1080203 (res/drawable-mdpi/jog_tab_right_confirm_gray.png) that
varies with configuration!!
03-16 22:30:36.616: WARN/Zygote(33): Preloaded drawable resource
#0x1080209 (res/drawable-mdpi/jog_tab_right_normal.png) that varies
with configuration!!
03-16 22:30:36.646: WARN/Zygote(33): Preloaded drawable resource
#0x108020a (res/drawable-mdpi/jog_tab_right_pressed.png) that varies
with configuration!!
03-16 22:30:36.675: WARN/Zygote(33): Preloaded drawable resource
#0x108020d (res/drawable-mdpi/jog_tab_target_gray.png) that varies
with configuration!!
  how to remove that type of error

-- 

3. Wifi port issue (all works except the backend)

4. Alhamdulillah... Miley ku dah pake cyanogen 6

5. [WTShare] GUI for Darktremor Apps2SD

6. Suppoting android 1.6. VerifyError.

7. Problem in accessing the phone