Reference Link: http://www.appsdeveloperblog.com/enable-disable-android-app-backups-restore/
Programmer's World
Friday, 29 June 2018
Android allowBackup
To enable or disable android app from being backed up or restored you can use AndroidManifest.xml file and android:allowBackup=”false” which if present and is set to false will prevent even a full-system backup that would otherwise cause all application data to be saved via adb. The default value of this attribute is true.
Sunday, 22 April 2018
Continuous Integration
Continuous Integration (CI) is a development practice that requires developers to integrate code into a shared repository several times a day. Each check-in is then verified by an automated build, allowing teams to detect problems early.
By integrating regularly, you can detect errors quickly, and locate them more easily.
Some reference links on CI:
https://www.thoughtworks.com/continuous-integration
https://www.visualstudio.com/learn/what-is-continuous-integration/
Thursday, 25 January 2018
Scrollable TextView Android
How to make a TextView Scrollable?
1: Add android:scrollbars="vertical" tag in TextView.
2: In activity or fragment just get the reference of TextView and set tv.setMovementMethod(new ScrollingMovementMethod());
Now, It is done. You have successfully make your TextView scrollable.
1: Add android:scrollbars="vertical" tag in TextView.
2: In activity or fragment just get the reference of TextView and set tv.setMovementMethod(new ScrollingMovementMethod());
Now, It is done. You have successfully make your TextView scrollable.
Monday, 10 July 2017
Android library worth using
Android library worth using:
Every Android developer should use these libraries in their projects. These libraries reduce code boilerplate and provide many other advantages.1. Data Binding:
It helps you to write declarative layouts and minimize the glue code necessary to bind your application logic and layouts.The Data Binding Library offers both flexibility and broad compatibility — it's a support library, so you can use it with all Android platform versions back to Android 2.1 (API level 7+).
Reference Link: [https://developer.android.com/topic/libraries/data-binding/index.html]
2. Butter Knife:
Field and method binding for Android views which uses annotation processing to generate boilerplate code for you.
- Eliminate
findViewByIdcalls by using@BindViewon fields. - Group multiple views in a list or array. Operate on all of them at once with actions, setters, or properties.
- Eliminate anonymous inner-classes for listeners by annotating methods with
@OnClickand others. - Eliminate resource lookups by using resource annotations on fields.
Reference Link: [https://github.com/JakeWharton/butterknife]
3. Retrofit:
Retrofit is a REST Client for Android and Java by Square. It makes it relatively easy to retrieve and upload JSON (or other structured data) via a REST based webservice. In Retrofit you configure which converter is used for the data serialization. Typically for JSON you use GSon, but you can add custom converters to process XML or other protocols. Retrofit uses the OkHttp library for HTTP requests.
Reference Link: [http://www.vogella.com/tutorials/Retrofit/article.html]
4. Rx-Android:
https://www.raywenderlich.com/141980/rxandroid-tutorial
5. Dagger 2:
Dagger 2 is dependency injection framework. It is based on the Java Specification Request (JSR) 330. It uses code generation and is based on annotations. The generated code is very relatively easy to read and debug.
Reference: [http://www.vogella.com/tutorials/Dagger/article.html]
6. Room:
Room provides an abstraction layer over SQLite to allow fluent database access while harnessing the full power of SQLite.
Reference: [https://developer.android.com/topic/libraries/architecture/room.html]
7. Glide/Picasso:
Glide: Glide is a fast and efficient open source media management and image loading framework for Android that wraps media decoding, memory and disk caching, and resource pooling into a simple and easy to use interface.
Picasso: Images add much-needed context and visual flair to Android applications. Picasso allows for hassle-free image loading in your application—often in one line of code!
Friday, 19 May 2017
Android Kotlin
Adding Kotlin langauge support in Android Studio
Go to File -> Settings -> Plugin -> Browse Repositories -> Search Kotlin -> Install Kotlin plugin -> Restart Android Studio
Convert java code into Kotlin code
Goto Android studio code menu -> Convert java to kotlin
Monday, 31 October 2016
Firebase Overview
Here are some overview of Firebase Features:
Firebase analytics:
Firebase Analytics collects usage and behavior data for your app.
Firebase cloud messaging:
Using FCM, you can notify a client app that new email or other data is available to sync. You can send notification messages to drive user re-engagement and retention. For use cases such as instant messaging, a message can transfer a payload of up to 4 KB to a client app.
FCM: Firebase cloud messaging (Updated form of GCM)
FCM: Firebase cloud messaging (Updated form of GCM)
Firebase Authentication:
Most apps need to know the identity of a user. Knowing a user's identity allows an app to securely save user data in the cloud and provide the same personalized experience across all of the user's devices.
Firebase Authentication provides backend services, easy-to-use SDKs, and ready-made UI libraries to authenticate users to your app. It supports authentication using passwords, popular federated identity providers like Google, Facebook and Twitter, and more.
Firebase Realtime Database:
Store and sync data with our NoSQL cloud database. Data is synced across all clients in realtime, and remains available when your app goes offline.
The Firebase Realtime Database is a cloud-hosted database. Data is stored as JSON and synchronized in realtime to every connected client. When you build cross-platform apps with our iOS, Android, and JavaScript SDKs, all of your clients share one Realtime Database instance and automatically receive updates with the newest data.
Firebase Storage:
Firebase Storage lets you upload and share user generated content, such as images and video, which allows you to build rich media content into your apps. Firebase Storage stores this data in a Google Cloud Storage bucket, a petabyte scale object storage solution with high availability and global redundancy. Firebase Storage lets you securely upload these files directly from mobile devices and web browsers, handling spotty networks with ease.
Firebase Test Lab for Android:
Test your app on devices hosted in a Google datacenter.
RecyclerView
RecyclerView:
The RecyclerView widget is a more advanced and flexible version of ListView. This widget is a container for displaying large data sets that can be scrolled very efficiently by maintaining a limited number of views. Use the RecyclerView widget when you have data collections whose elements change at run-time based on user action or network events.A layout manager positions item views inside a RecyclerView and determines when to reuse item views that are no longer visible to the user. To reuse (or recycle) a view, a layout manager may ask the adapter to replace the contents of the view with a different element from the data set. Recycling views in this manner improves performance by avoiding the creation of unnecessary views or performing expensive findViewById() lookup.
RecyclerView provides these built-in layout managers:
- LinearLayoutManager shows items in a vertical or horizontal scrolling list.
- GridLayoutManager shows items in a grid.
- StaggeredGridLayoutManager shows items in a staggered grid.
Support older Version:
At the time of writing, less than 2% of Android devices run Android Lollipop. However, thanks to the v7 Support Library, you can use the RecyclerView and CardView widgets on devices that run older versions of Android by adding the following lines to the dependencies section in your project's build.grade file:
1- compile 'com.android.support:cardview-v7:21.0.+'
2- compile 'com.android.support:recyclerview-v7:21.0.+'
ListView vs RecyclerView
1. Reuses cells while scrolling up/down - this is possible with implementing View Holder in the listView adapter, but it was an optional thing, while in the RecycleView it's the default way of writing adapter2. Decouples list from its container - so you can put list items easily at run time in the different containers (linearLayout, gridLayout) with setting LayoutManager.
3. Animates common list actions - Animations are decoupled and delegated to ItemAnimator.
Subscribe to:
Posts (Atom)
