Wirelessly Debugging of your Android App on Smartphone

First Set Path for adb command through system environment variable : F:\adt-bundle-windows-x86_64-20140702\sdk\platform-toolsNow type following commands on command prompt : Connect device via USB and make sure debugging is working. adb tcpip 5555 adb connect <DEVICE_IP_ADDRESS>:5555 Disconnect USB and proceed with wireless debugging. adb -s <DEVICE_IP_ADDRESS>:5555 usb to switch back when done. <DEVICE_IP_ADDRESS> : type following command […]

Make phone call using intent in android

1. Add below permission in manifest file : <uses-permission android:name=”android.permission.CALL_PHONE” /> 2. Use below code for phone call. String mobileno = “9999999999”; String uri = “tel:” + mobileno.trim() ; Intent intent = new Intent(Intent.ACTION_CALL); intent.setData(Uri.parse(uri)); startActivity(intent);

How to implement share via option in android

Intent i=new Intent(android.content.Intent.ACTION_SEND); i.setType(“text/plain”); i.putExtra(android.content.Intent.EXTRA_SUBJECT,”Subject test”); i.putExtra(android.content.Intent.EXTRA_TEXT, “extra text that you want to put”); startActivity(Intent.createChooser(i,”Share via”));

How to check internet is connected or not in android

import android.content.Context; import android.net.ConnectivityManager; import android.net.NetworkInfo; public class NetworkCheck { public static boolean hasInternetConnection(Context context) { ConnectivityManager cm = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE); NetworkInfo wifiNetwork = cm.getNetworkInfo(ConnectivityManager.TYPE_WIFI); if (wifiNetwork != null && wifiNetwork.isConnected()) { return true; } NetworkInfo mobileNetwork = cm.getNetworkInfo(ConnectivityManager.TYPE_MOBILE); if (mobileNetwork != null && mobileNetwork.isConnected()) { return true; } NetworkInfo activeNetwork = cm.getActiveNetworkInfo(); if (activeNetwork […]