Breaking News
Home / Android (page 2)

Android

Cannot get a list of Calendar in Android

Issue Getting a exception while trying to get a list of calendar in an Android device. 07-06 13:26:51.969: E/AndroidRuntime(19053): Caused by: java.lang.SecurityException: Permission Denial: reading com.android.providers.calendar.HtcCalendarProvider uri content://com.android.calendar/calendars from pid=19053, uid=10206 requires android.permission.READ_CALENDAR, or grantUriPermission() 07-06 13:26:51.969: E/AndroidRuntime(19053):      at android.os.Parcel.readException(Parcel.java:1430) Solution The following permissions are required to read and write …

Read More »

Email Validator in Android

The snippet shows an Email Validator using RegEx. package com.livetraxs.app.activity.util;   import java.util.regex.Matcher; import java.util.regex.Pattern;   public class EmailValidator {           private Pattern pattern;         private Matcher matcher;           private static final String EMAIL_PATTERN = "^[_A-Za-z0-9-+]+(.[_A-Za-z0-9-]+)*@"       …

Read More »

android.os.NetworkOnMainThreadException – StrictMode$AndroidBlockGuardPolicy

Usecase Sending a request to invoke a URL/API/Resource over the Internet from the Activity. Exception E/LiveTraxs(29173): HttpApiService:81-Exception : nullE/LiveTraxs(29173): android.os.NetworkOnMainThreadExceptionandroid.os.StrictMode$AndroidBlockGuardPolicy.onNetwork(StrictMode.java:1208)E/LiveTraxs(29173):     at java.net.InetAddress.lookupHostByName(InetAddress.java:388)E/LiveTraxs(29173):     at java.net.InetAddress.getAllByNameImpl(InetAddress.java:239)E/LiveTraxs(29173):     at java.net.InetAddress.getAllByName(InetAddress.java:214)E/LiveTraxs(29173):     at libcore.net.http.HttpConnection.<init>(HttpConnection.java:70)E/LiveTraxs(29173):     at libcore.net.http.HttpConnection.<init>(HttpConnection.java:50)E/LiveTraxs(29173):     at libcore.net.http.HttpConnection$Address.connect(HttpConnection.java:340)E/LiveTraxs(29173):     at libcore.net.http.HttpConnectionPool.get(HttpConnectionPool.java:87)E/LiveTraxs(29173):     at libcore.net.http.HttpConnection.connect(HttpConnection.java:128)E/LiveTraxs(29173):     at libcore.net.http.HttpEngine.openSocketConnection(HttpEngine.java:315)E/LiveTraxs(29173):     at libcore.net.http.HttpEngine.connect(HttpEngine.java:310)E/LiveTraxs(29173):     at libcore.net.http.HttpEngine.sendSocketRequest(HttpEngine.java:289)E/LiveTraxs(29173):     at libcore.net.http.HttpEngine.sendRequest(HttpEngine.java:239)E/LiveTraxs(29173):     at libcore.net.http.HttpURLConnectionImpl.connect(HttpURLConnectionImpl.java:80)libcore.net.http.HttpURLConnectionImpl.getOutputStream(HttpURLConnectionImpl.java:188) Cause & Solution The …

Read More »

How do you uninstall an Android App using ADB?

In order to uninstall/delete an existing App on the device you can either Uninstall from the Device it self as any other regular app. This way of uninstalling requires more steps,  developers can do it faster via the ADB  tool using the following command: adb shell am start -a android.intent.action.DELETE …

Read More »
Advertisment ad adsense adlogger