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.
Posts
Xiomi MIUI 9 Wallpaper Android App
- Get link
- X
- Other Apps
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
- Get link
- X
- Other Apps
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
- Get link
- X
- Other Apps
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
- Get link
- X
- Other Apps
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
- Get link
- X
- Other Apps
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)
- Get link
- X
- Other Apps
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); ...
New Navigation View
- Get link
- X
- Other Apps
Navigation Drawer is an important feature of any android app. Its need is when you navigate some particular pages of your app. In new android support design library, Navigation View is officially released, before we used Navigation Drawer. Let's create Navigation View. First Create New Project Add this library to app's build.gradle file in dependencies and click sync now : compile 'com.android.support:design:23.1.0' Now change to your layout file's content as below where you want to add drawer: <android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/drawer_layout" android:layout_width="match_parent" android:layout_height="match_parent" android:fitsSystemWindows="true" tools:context=".MainActivity"> <LinearLayout android:...
ToolBar
- Get link
- X
- Other Apps
ToolBar is complete replacement of Android ActionBar. It provides greater controls to user to customize its appearance unlike Old ActionBar. Its introduced in Android Lollipop, API 21, hence its available to use in Support Design Library . I encourage you guys to hiding ActionBar and switch to ToolBar from now since new support design library with wonderful features designed to work together with ToolBar not ActionBar. Let's do that. First Create New Project Its easy to switch to ToolBar. Just hide ActionBar from style.xml <style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar"> <!-- Customize your theme here. --> <item name="colorPrimary">@color/colorPrimary</item> <item name="colorPrimaryDark">@color/colorPrimaryDark</item> <item name="colorAccent">@color/colorAccent</item> </style> Now run your project. You see below output with...
Creating New Project in Android Studio
- Get link
- X
- Other Apps
Say good bye to workspace, welcome to modules. From now a days, we will develop any code in Android Studio. For that, today I'll teach you, how to create android project in Android Studio. Download Android Studio and install in your system with JAVA installed. After installing Android Studio, create new project as shown below: Then you can see below screen: Here there are 4 fields: Application Name: App name that you see when you install an app Company Domain: You can set any domain Package Name: This name will be unique for each app. That is auto-generated as you type Application Name, it refers as per Company Domain. You can manually edit it. Project Location: Source directory of your project. Click Next , you will see below screen. This is screen for asking which types of devices does support your app. By default, its set to Phone and Tablet and set to your minimum SDK Version. Other options are: Wear: For wear devices like ...
Get Current Location using GPS/Network Provider
- Get link
- X
- Other Apps
Hello to all, Today I teach you that how can we get current location. In android's new SDK tools, LocationManager class does not give any network provider's status. It always gives null value. Still it works in some of the android devices rarely. So that's why I include code for both network provider and gps provider for getting current location. Create one service class name LocationFinder and implements it LocationListener . All the code which is related to Location, is doing in that service class and from MainActivity , call its method through its instance in onResume() method. The reason you know, why its called in onResume(), because when you enable GPS and come back in activity, then its again check Location's status. In the code, if GPS not enable, I show settings alert pop-up, to go settings menu. When you enable GPS, you will get current location after 2-3 seconds. If not, come again to activity and surely get location. Make sure, must add persmi...
Detect Internet Connection
- Get link
- X
- Other Apps
Let's test a code in which you can detect if there is an active internet connectivity or not in your app programmatically. Create one class named Functions Create one method in that class as below: public static boolean isConnecting(Context context) { ConnectivityManager connectivityManager = (ConnectivityManager) context.getSystemService(Context. CONNECTIVITY_SERVICE ); NetworkInfo activeNetworkInfo = connectivityManager.getActiveNetworkInfo(); return activeNetworkInfo != null && activeNetworkInfo.isConnected(); } Now in your Activity, do this at where you want to check internet connection status: if (Functions.isConnecting(this)) { // you have internet connection // do your stuff here } else { Toast.makeText(this, "No internet connecion.", Toast.LENGTH_LONG).show(); }
Set current date to Button and Datepicker dialog
- Get link
- X
- Other Apps
This tutorial is going to explain how to set current date on Button and when you click on that Button, DatePicker Dialog open to ask your new Date. When you set Date from datepicker dialog, selected Date will be set to that Button. A simple Layout with just only Button. <Button android:id="@+id/date" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="10dp" android:onClick="setDate" /> For Date related task, you have to use Calendar class. And to get current Date, use method getInstance() of Calendar class. Calendar cal = Calendar.getInstance(); mYear = cal.get(Calendar.YEAR); mMonth = cal.get(Calendar.MONTH); mDay = cal.get(Calendar.DAY_OF_MONTH); mYear, mMonth, mDay is of int type. Now set date o...