Posts

Using Google API for GPS

Using Google API for GPS This post will show you how implement a Google Service Step 1 Enable the service on AndroidManifest.xml         <service android:name="mx.com.yourAppName.Globals.GpsService">         </service> Step 2 Add this class. This class can mantain service on and show an alert window if the GPS service in off and send to activate service. package mx.com. yourAppName .Globals; import android.Manifest; import android.app.Activity; import android.app.AlertDialog; import android.app.Service; import android.content.Context; import android.content.DialogInterface; import android.content.Intent; import android.content.pm.PackageManager; import android.location.Location; import android.location.LocationManager; import android.os.Build; import android.os.Bundle; import android.os.Handler; import android.os.IBinder; import android.provider.Settings; import android.support.annotatio...

How I can create class for reuse it

How I can create class for reuse it? Well one in the most important trick for build scalable and big applications is build with structure and reuse for reduce complexity and work more easy and fast. -- Divide and Conquer --  Now, I will recoment follow this. Just you make a public class and you can import from other classes for example: public class MyClass{    code here } You can make a folder, for example called "Globals" and put the file in this folder. After that you can import folder like a package like this. packge mx.com.apname.Globals; And now you can use the class. References Document https://developer.android.com/reference/android/support/v7/app/AppCompatActivity Videos explan what is ActivityComponent https://www.youtube.com/watch?v=D4J6WZjRQV0 

How change the min and max API

Image
How change the min and max API You need know what is your min and max API, because it could be a problem. You can change this in Go to Grandle Script and change the min and max Next step is go to the right corner and click on Sync. It could be take some time depending your hardware, if all it's right you should see this. In the next table you can see a history API, linux kernel versión and deployment dates. This is the versions grid update at 20-Febrary-2019

Install an Android Asynchronous Http Client

Image
Install an Android Asynchronous Http Client Android Asynchronous Http Client its a Library that allow us get data from a web server, this library it should be install into Android App. For this example I'm using a new project App. For install follow this steps. 1.- Select the Android option into your project 2.- Open this file into your Grandle. 3.- Add this line into de dependencies secction.  This will install this library, is necesary Sync. 5.- You will see some like this in your log.  6.-  Import class. Now you can import the class into your MainActivity or another. import com.loopj.android.http.* ; 7.- Add Permisson to Add permission for Access to internet. Open the file "AndroidManifiest.xml" and add this line <uses-permission android :name= "android.permission.INTERNET" /> Like this image 8.- Test a simple request In the main activity just page this.  You will need import ...