Archive | ANDROID

RSS feed for this section

Android: how to use Github with Android Studio

Read first: How to use Github.com on Windows Step 1: Go to File -> Settings -> Version Control -> Github and fill your Github Account. You can use the button Test for test your account information. Then, click OK Step 2: Setup master password (optional ) Step 3:¬†Go to File -> Settings -> Version Control […]

Read full story Comments { 0 }

Android: how to post http request

Step 1: prepare a simple Endpoint API to test. I.e. http://demo.tutorialspots.com/android/postdata/login.php Step 2: create new android project Step 3: create the layout res\layout\activity_main.xml Step 4: open file app\build.gradle add: and The full code of file app\build.gradle Click Sync Now Step 5: file AndroidManifest.xml add Step 6: file MainActivity.java Step 7: run for test

Read full story Comments { 0 }

Some errors most view when use Android Studio 1.5 – Part 2

Read part 1 first: Some errors most view when use Android Studio 1.5 Error 5: when launch an AVD Fix: Go to android SDK manager, and install your system image Error 6: when launch an AVD Fix: change your screen size of your AVD

Read full story Comments { 0 }

Android: how to check a valid phone number

To learn how to validate a phone number, we create a simple example. Step 1: create new android project Step 2: create the layout: res\layout\activity_main.xml Step 3: file MainActivity.java Step 4: run for test Sample phone number for test: (425) 555-1212 +14255551212

Read full story Comments { 0 }

Android: how to check a valid email address

To learn how to validate an email address, we create a simple example. Step 1: create new android project Step 2: create the layout: res\layout\activity_main.xml Step 3: file MainActivity.java Step 4: run for test

Read full story Comments { 0 }

Android: how to get image from url

To learn how to get image from url, we create a simple example. Step 1: create new android project. Step 2: file AndroidManifest.xml add: Step 3: create the main layout: res\layout\activity_main.xml Step 4: create new class ImageViewHelper.java Step 5: file MainActivity.java Method 1: Note: if you don’t use the code: You will get the error: […]

Read full story Comments { 0 }

Android Studio in Linux 32 bits: error Cannot launch AVD in emulator

If you use Android Studio in Linux 32 bits, and you get the error: You can follow some steps to fix it. Step 1: open terminal in linux (like kali linux) Step 2: use this command: gedit .bashrc Step 3: paste text: export ANDROID_EMULATOR_FORCE_32BIT=true Step 4: use this command: source ~/.bashrc Step 5: reboot your […]

Read full story Comments { 0 }

Android Lesson 11: work with AsyncTask

To keep things simple, we can understand AsyncTask like AJAX that we already know. We create a simple example. In this example we are going to load a website in the background and display it in a WebView. Step 1: create new android project. Step 2: file AndroidManifest.xml, add to set permission to use Internet. […]

Read full story Comments { 1 }

Android Lesson 10 part 2: how to check if a service is running

We create an simple example to learn how to check if a service is running. In this example, we learn how to use Handler and Runnable in a service too. (You can read this tutorials for more information: Android Lesson 5: android.os.Handler) Step 1: create new Android project Step 2: create new class DemoService Step […]

Read full story Comments { 0 }

Android Lesson 10: Work with Service

A Service is an application component used to perform long-running tasks in background. There are 2 types of Service: Bound Service: A bound service is the server in a client-server interface. A bound service allows components (such as activities) to bind to the service, send requests, receive responses, and even perform interprocess communication (IPC). A […]

Read full story Comments { 0 }