Posts

Showing posts from April, 2017

Android Spinner with Dialog Box

Why this post? Sometimes for visual effect, we need to show the spinner item in a dialog box which is most customizable and designable. UX engineers also try to make the more complex situation. That's why I made a spinner where spinners item will be shown in the dialogue box. Techniques which I used: For this purpose, I used Dialog, RecyclerView and EditText. 1. When clicked on EditText a Dialog Box will appear. 2. Dialog box holds a RecyclerView with an adapter where adapter holds a TextView. 3. Then implement a OnItemClick listener in RecyclerView. 4. Then item text will set on EditText. Codes with Description: Dialog layout: dialog.xml <? xml version= "1.0" encoding= "utf-8" ?> < LinearLayout xmlns: android = "http://schemas.android.com/apk/res/android" android :orientation= "vertical" android :layout_width= "match_parent" android :layout_height= "match_parent" > <

Install APK in Wearable device without Android Studio,Eclipse or ADB

This is the big concern about wearable development how I will install wearable apk in wearable device? We can install it three ways :  - Using android development IDE (Android Studio, Eclipse etc)  - Using ADB without IDE  - Direct from play store But main problem is client are not always well trained to install apk using IDE or ADB. So what is the easiest way? Easiest way to install wearable apk : 1. Make sure your package name of wearable and mobile are same.Go to AndroidManifest .xml file both these module and check whether these are same or not. If same then ok otherwise you have make them same. 2. Normally, There two apk's are available in wearable project one is "Mobile APK" and another is "Wearable APK". 3. We have to build signed apk for "Mobile apk". If any one doesn't know how to build signed apk you ca see this video - click here . 4. When APK build successfully you can find it in "Your_Project\mobile" folder. 5

Android Wearable learning materials-Basic Guideline

Official Videos of Google: This is too much necessary or mandatory that everyone should go through the whole video lessons about wearable which are provided by Google officially. Video Links: https://classroom.udacity.com/courses/ud875A/lessons/4493351882/concepts/45342601910923 *Note: Wearable app are three types: -         Notifications -         Wearable Apps -         Watch Faces In this video section there are three Lessons (please see all the lessons without any seeking) -         Run the sample codes which are provided my Google. Link : https://github.com/googlesamples/android-WatchFace Watch Faces for Android Wear 1.     There are some basic terms and mode in android wear. Basic terms are already described in video tutorials but this link is very good for basic description of android watchfaces.               Link: https://developer.android.com/design/wear/watchfaces.html 2.     Creating watch face step by step with descript

Mode/State of Android Watch face

Basically there are two Modes/States of android watch faces, these are 1.     Interactive Mode 2.     Ambient Mode Interactive Mode: When the user moves their wrist to glance at their watch, the screen goes into interactive mode. Your design can use full color with fluid animation in this mode. Interactive mode is open for user to interact with watch face so that here is open for all power consumption. The animation, color all are visible in interactive mode. Picture of Interactive mode : https://developer.android.com/design/media/wear/Render_Interactive.png Ambient Mode: Ambient mode helps the device conserve power. Your design should make clear to the user that the screen is in ambient mode. The background color scheme is  strictly limited  to black, white, and grays. Your watch face may use some color elements on screens that support it provided it is unambiguous that the device is in ambient mode. You can use color elements for up to 5 percent of tot

Marquee Text Android: Using RecyclerView like Ticker

Image
Why this article? Sometimes in our Android, apps need a marquee text effect, like a smooth auto scroll horizontally or vertically. Example For breaking news apps, there is a necessary functionality, which shows the breaking news, such as on a horizontal scroll. In share market apps, the top app should give an auto scroll effect to show the text. In Android, there is no perfect library for marquee text but in this blog, I will give the simplest solution for marquee text. Procedure Add RecyclerView, as per your desire and also add dependency. XML 1. <android.support.v7.widget.RecyclerView   2.     android:id="@+id/rec_all_stocks"   3.     android:layout_width="match_parent"   4.     android:layout_height="match_parent"   5.     android:scrollbars="vertical"   6.     android:layout_alignParentLeft="true"   7.     android:layout_alignParentStart="true"></android.support.v7.widget.RecyclerView>  

How to download PDF from byte array or byte stream - Android

How to download PDF from byte array or byte stream - Android We can download easily pdf from byte stream, for that one have to follow some necessary steps. Step 1 : Have to give read and write external storage permission in AndroidMenifest.xml file : < uses-permission android:name = "android.permission.READ_EXTERNAL_STORAGE" /> < uses-permission android:name = "android.permission.WRITE_EXTERNAL_STORAGE" /> Step 2 : The main problem is though we gave permission but in higher android version need to give permission manually form Application settings. This is to much annoyed for any non-technical users because they want their PDF but they will not take this hassles. So we have to do this from program where user will notify he/she wants to give permission or not. This way - public static boolean isStoragePermissionGranted (Activity activity) { if (Build.VERSION.SDK_INT >= 23 ) { if (ContextCompat.checkSelfPermission