How does android interact with dynamic services?

I am trying to develop an application and I want it to fetch data from a database mySQL

. But from some readings I've done on various sites, I understand that this probably won't happen. But I'm curious to know how apps like PhoneFlix and others treat this dynamic data in the app? Is it somehow easy to bring it through http? If so, how do I do it? Does anyone know of any good sites that point me in the right direction? Thanks to

ezekielweb

+2


a source to share


1 answer


Well first of all, android provides sqlite, not mysql. :)

You can create a thread that does whatever you want and it can interact with the activity front with the Bundle when you implement the Handler in your activity.

for example below ...



private void do_what_i_want() {

  new Thread() {

   public void run() {

     Bundle b = new Bundle();
     b.putString("whatyouwant", value);

     Message m = new Message();
     m.setData(bundle);
     handler.sendMessage(msg);
   }

 }.start

}


private Handler handler = new Handler() {

 @Override

 public void handleMessage(Message msg) {

   super.handleMessage(msg);

   Bundle b = msg.getData();

   String whatyouwant = b.getString("whatyouwant");

   ["you can refresh your view here"]

 }

}

      

hope i am on the right track ...: p

0


a source







All Articles