Tampilkan postingan dengan label url. Tampilkan semua postingan
Tampilkan postingan dengan label url. Tampilkan semua postingan

Starting With Eclipse and Android SDK or Configuring Android in Eclipse.

Posted by Unknown Selasa, 14 Mei 2013 0 komentar

See more basics on Android

The Android SDK provides you the API libraries and developer tools necessary to build, test, and debug apps for Android.
Download the SDK from here....

Now you have sucessfully downloaded the ADT Bundle.
The ADT Bundle provides everything you need to start developing apps, including a version of the Eclipse IDE with built-inADT (Android Developer Tools) to streamline your Android app development. 

  • Download provide you with a zip file.
  • Unpack the zip file and save it to the appropriate location. 
  • Go to the adt-bundle-<os_platform>/eclipse/ directory and launch eclipse.
  • That's it! The IDE is already loaded with the Android Developer Tools plugin and the SDK is ready to go.Now develop your own application.
You may find your latest updates from Android SDK Manager.The SDK Manager shows all the SDK packages available for you to add to your Android SDK.
Go to windows->Android SDK manager 
   


And If your eclipse fails to find the SDK you may clear this by checking in windows-> Preferences.
Take preferences and you may see a window appearing like below.



Click on Android and you can browse the path of SDK here.

I you wanted to create a new emulator or edit the already created one you can go to 
windows - >Android Virtual Device Manager , and a window appear like below where new, edit ,delete options are there.



Wanted to create a new emulator click on "new" from the above window and a new window appear like below where you have to enter all the field to create an appropriate one.



same way try with delete and edit also.



Baca Selengkapnya ....

Connecting to a remote mysql database using php and Android?

Posted by Unknown Sabtu, 04 Mei 2013 0 komentar
Connecting to a remote database has been a Herculean Task for some programmers. No more worries here is a simple post to make it really simple. Follow these steps exactly to get it done.

Remember these when you are working with an online database.

1. Make sure that you have a running server.
2. INTERNET permission should be present in the AndroidManifest file of your app.
3. The path that you give in your program to point to the server file should be correct.

After ensuring all these you are ready to go.

First we will start with the Server side. Here I am going with a PHP example.

I am getting a value from the Android side by using a variable say "my_val".
Then the PHP script will look like this.
Note that here I am only sending one value from the Android side to the PHP Side.
so the Server side code will look like this.



$val = $_POST['my_val'];
echo $val;


Look at the varaible name inside the $_POST. Make sure that you use the same variable name in the Android side also. It is also case sensitive.

Here I am echoing back any value that is sending from the Android side.
You can do anything with it in the server side. Here I am just echoing it back.
You can simply insert it into a database and echo something else. Anything you echo will be received by the Android

Our Server side code is complete
Now we switch on to the Android side.

This is the code that connects with the server.



Thread thread = new Thread()
{
@Override public void run()
{
try
{
httpclient=new DefaultHttpClient();
httppost= new HttpPost("your url");
}
}
// make sure the url is correct.
//add your data
nameValuePairs = new ArrayList<NameValuePair>(1);
nameValuePairs.add(new BasicNameValuePair("my_val","my Test value from the Android Side"));
httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));
//Execute HTTP Post Request response=httpclient.execute(httppost);
ResponseHandler<String> responseHandler = new BasicResponseHandler();
final String response = httpclient.execute(httppost, responseHandler);
System.out.println("Response : " + response);
}
catch(Exception e)
{
System.out.println("Exception : " + e.getMessage());
}
}
};
thread.start();



If you are working on LocalHost use url "http://10.0.0.2/your_folder_address.php"

OK Done. You have successfully connected to a remote server. Check your LogCat for the value from the server Make sure you have internet connection before doing this, otherwise exception will be thrown. By this way you can send any number of variables from the Android side to the PHP side but make sure that both have the same name (case sensitive).

Baca Selengkapnya ....
Trik SEO Terbaru support Online Shop Baju Wanita - Original design by Bamz | Copyright of android populer.