In Android, I am trying to use the database at a predefined time. In my application, it runs a simple Android service and inside it I want to check external database (MySQL) at a specific time. I am using the Java Web service to access the database.
Provides public class DBService service {personal fixed final string SOAP_ACTION = "http://dbconnectivity.com/test/"; Private static final string METHOD_NAME = "test"; Personal Static Last String NAMESPACE = "http://dbconnectivity.com"; Private Static Last String URL = "http://10.0.2.2:8089/DB_Connectivity/services/SqlConnectivity?wsdl"; Letter string; @ Override public ibindor on bind (intent intent) {// TODO auto-generated method stub returns empty; } @ Override Public Wide On Crack () {Super. Connet (); //Toast.makeText (this, "test", toast.lNGTH_LONG). Show (); SOAP object request = new SOAP object (NAMESPACE, METHOD_NAME); Request.addProperty ("time", 0); SoapSerializationEnvelope envelope = new soap Enification (Envelope.edvelopment.updateOutputSoapObject (request); httpTransportSHT = new HTTP transportS (url); Try Ht.call (SOAP_ACTION, envelope); SoapReactionReaction = (Soapprimitive) EnvelopeGetresons ); SoapProtectic S = reaction; Str = s.toString ();} Grip (Exception E) {e.printStackTrace ();} Toast. Maketext (This, "Test" + Str, Toast. LNNHHLLJ Show) ();} @ Override public empty ondestoy () {super. Onsteroy (); toast.make text (this, "service is destroyed ...", toast.LnnHH_LOG) Show ();}} < / Code> How to do this task?
See the alarmmaker class or tutorial Check and click on the MySQL server on the myspace server at the specified time (you will need some php scripts to give results from MySQL, Because Android does not directly support DB connections)
Comments
Post a Comment