Posts

Showing posts with the label Android

Android-How To Reload Fragment & Activities

Image
For Fragment Reload // Reload current fragment Fragment frg = null ; frg = getSupportFragmentManager (). findFragmentByTag ( "Your_Fragment_TAG" ); final FragmentTransaction ft = getSupportFragmentManager (). beginTransaction (); ft . detach ( frg ); ft . attach ( frg ); ft . commit (); Your_Fragment_TAG is the name you gave your fragment when you created it This code is for support library. If you're not supporting older devices, just use  getFragmentManager  instead of  getSupportFragmentManager For Activity Reload Intent i = new Intent(MainActivity.this, MainActivity.class); finish(); overridePendingTransition(0, 0); startActivity(i); overridePendingTransition(0, 0); In the above code, we have used overridePendingTransition(), it is used to remove activity create animation while re-creating activity.

20+ Awesome Open-Source Android Apps To Boost Your Development Skills [ 2019 ]

Image
The best way to learn is to read and that’s true for a developer as well. If you want to become a better developer, you have to read more code. It’s as simple as that. Books, blogs, forums are all good to a certain extent but there is nothing that can replace some fully-functional, exhaustive open-source projects where the entire app with all its resources is right in front of you. All you have to do is sit back, take a cup of coffee and read some kick-ass code . Here in this article, we bring some of the best open-source Android apps from various categories and genres to fulfill all your learning and development needs. You can try these apps directly from Play Store to have a hands-on experience before diving deep into the code. The difficulty level attached with each app will help you to judge if you should instantly dive into it or put it aside for the time being. LeafPic ( Github | Play Store | Difficulty: Beginner) Photo and video gallery app...

Flutter: Getting Started

Image
  Introduction It has been over 6 months that Flutter 1.0 was released by Google and the Flutter Community is growing day by day. At the time of writing this article Flutter, 1.5 is available. Now, Flutter is pretty stable and is gaining attention from developers all around the world. Flutter is Google’s portable UI toolkit for building beautiful, natively-compiled applications for mobile, web, and desktop from a single codebase. You can check it out on the Flutter Official Website . So, if you haven’t yet started developing apps with Flutter, you should get on-board as soon as possible because it is better late than never. For the people who have very little knowledge about Flutter and what it is about, you have come to the right place. I will start for the very beginning. Many people who want to get started with Flutter app development have a big confusion that Flutter is a language. NO, Flutter is not a language as I have also stated before that ...

Android: Bottom Sheet

Image
Credit: material.io Bottom sheet is a component that slides up from bottom of the screen to reveal more content. You can find more detailed information of Bottom Sheet on Google Material Design guidelines.   Adding resources Add the latest appcompat and design support library to your project. dependencies { //replace X.X.X with the latest version compile 'com.android.support:appcompat-v7:X.X.X' compile 'com.android.support:design:X.X.X' }   Make your activity extend AppCompatActivity . public class ButtonActivity extends AppCompatActivity { ... } Creating layouts Bottom sheet content We’ll include the layouts for the sake of simplicity. This is the layout that will contain the content of the bottom sheet . File is bottom_sheet.xml . <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas....

Android MaterialDrawer - A Custom Navigation Drawer

Image
Does your application contain a Drawer ? Do you want to have it up and running in less than 5 minutes ? Do you want your drawer to follow the Android Design Guidelines ? Do you have profiles ? Do you need flexibility ? Is Google's navigation Drawer of the design support not enough for you? Do you want a simple and easy to understand api? If any (or all) of these questions seem familiar, the MaterialDrawer is the perfect library for you all. Never waste your time again. It provides you with the easiest possible implementation of a navigation drawer for your application. There is a Header with profiles ( AccountHeader ), a MiniDrawer for Tablets (like Gmail), provide custom DrawerItems , custom colors , custom themes , ... No limits for customizations. A quick overview of what's in it the easiest possible integration integrate in less than 5 minutes uses the androidX support libraries compatible down to API Level 14 includes an AccountSwitcher quick and simpl...