Posts

Well, I am here after a long long time. Just to inform my readers/followers that I have moved my profile from google blogpost to medium.com from Dec 2017 but forget to announce here. You can find me on below profile: https://droidbyme.medium.com/ All the articles are now posted on medium. So be in touch and keep reading my blogs on the given link.

Xiomi MIUI 9 Wallpaper Android App

Image
This application contains the best Wallpapers for MI3, MI4, MI Note Redmi Note, MIUI v6, v5. You will get the every single stock backdrop at one stop. Features:     - Easy to set your background wallpapers     - Download and Share colorful wallpapers to with circle     - You can zoom wallpapers by pinch or double tap     - No need for internet connection, Offline App     - Simple User friendly UI, Easy to use     - HD wallpaper     - Free Application     - Compatible with all Mi smartphones     - miui wallpaper     - Stay Updated This App Supports in Xiaomi MI, Samsung, Nokia, LYF, Vodafone, LeTv, Micromax, Lenovo, Gionee, Vivo, Motorola, Oppo, Alcatle, Asus, Zenfone, Huawei and others Android smartphones.

Tap N Deal Android App

Image
Tap n Deal provides you the latest best online shopping deals, offers and promo codes from Amazon, Flipkart, PhonePe, PayTm and many more on your mobile phone. Lots of recharge coupons for Prepaid/Postpaid Bill, DTH Recharge, Data Card, Electricity Bill, Gas Bill and many more. Apply promo codes from offer page and save money. Get Notification for latest daily deals and discounts.

How to make a phone call from your Android app

If you want to make a phone call from android app, write below code when you want to call on any number: Intent dialIntent = new Intent(); dialIntent.setAction(Intent.ACTION_DIAL); dialIntent.setData(Uri.parse("tel:9494299494")); If you want to call on dynamic number: String number = "9494942994"; Intent dialIntent = new Intent(); dialIntent.setAction(Intent.ACTION_DIAL); dialIntent.setData(Uri.parse("tel:"+number));  Intent.ACTION_DIAL brings up the dialer, but doesn't actually make the phone call. For make directly phone call, replace action as below: dialIntent.setAction(Intent.ACTION_CALL); You'll also have to declare android.permission.PHONE_CALL permission in your AndroidManifest.xml and above Android 6 (Marshmallow), give run-time permission. For run-time permission in android, I suggest  to use TedPermission library. TedPermission is a simple permission check helper.

Open app in Play Store

Write below code when you want to open any app programmatically,  String appPackageName = getPackageName(); // getPackageName() from Context or Activity object appPackageName = "com.whatsapp"; try { startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=" + appPackageName))); } catch (android.content.ActivityNotFoundException anfe) { startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("https://play.google.com/store/apps/details?id=" + appPackageName))); } Here, appPackageName = "com.whatsapp" is static. If you comment that line, your current app open in play store.

Android Date formatter and Time formatter

Date formatter and Time formatter are the ways to convert your date to various date formats, like: 03/01/2015 to 03/01/2015, Tue 03/01/2015 to 03/01/2015, Tuesday 03/01/2015 to 03 Jan, 2015 16:30:00 to 04:30 PM 04:30:00 to 04.30 AM and many more.. SimpleDateFormat class is used to change your format of date and time. Lets look at example,  String currentDate = "03/01/2015"; String inPattern = "dd/MM/yyyy"; String outPattern = "dd/MM/yyyy, EEE"; SimpleDateFormat input = new SimpleDateFormat(inPattern); SimpleDateFormat output = new SimpleDateFormat(outPattern); Date date = null; String convertedDate = ""; try { date = input.parse(currentDate); convertedDate = output.format(date); } catch (ParseException e) { e.printStackTrace(); } output: convertedDate = 03/01/2015, Tue Explanation: currentDate is the original date. inPattern in the dateformat of currentDate DateFormat outPattern in the dateformat of your convert

Shared Preference or Session Management (Login-Logout)

Image
Android provides many ways to store data in application. One of those ways is to use of Shared Preference . Shared Preference allows you to save and retrieve data in the form of key-value pair. For getting shared preference data of your app, you have to call a method getSharedPreference() , that will return SharedPreference instance that contains key-value pairs of preference. SharedPreferences preferences = getSharedPreferences("login", Context.MODE_PRIVATE); Remember this name "login" remains same for fetching all data related to login task and also its key: Suppose, we put "isUserLogin" boolean true after login success, then first time app launch, in Launcher Screen we have to check same key "isUserLogin". if (preferences.contains("isUserLogin")) { Intent intent = new Intent(SplashActivity.this, HomeActivity.class); startActivity(intent); } else { Intent intent = new Intent(SplashActivity.this, LoginActivity.class);