Skip to main content

Posts

Showing posts from February, 2019

Shortcuts in Android Studio for Android Developers - ABNHive

I hope these shortcuts will definitely help you to increase the productivity level. Search for command: cmd + shift + a ( Windows / Linux : ctrl +  shift + a) You just type: close and you’ll get a proper shortcut/command. Choose from the last copy / pastes : cmd +  shift  + v ( Windows / Linux : Ctrl + Shift + v). By default, there are 5 last copy/paste items. Enable mulmulti cursorature: ctrl + g (alt + j for Windows / Linux ). Open a class: cmd + o ( Windows / Linux : ctrl + n). Open any file: cmd + shift + o ( Windows / Linux : ctrl + shift + n) Open symbol:  cmd + option + o ( Windows / Linux : alt + shift + n). Go to implementation: cmd + option + b ( Windows / Linux : ctrl + alt + b). Go to declaration: cmd + b ( Windows / Linux : ctrl + b).  Go to type declaration: control + shift + b ( Windows / Linux : ctrl + shift + b).  Go to super: cmd + u ( Windows / Linux : ctrl + u).  Move between tabs: cmd + shift + [ (move left) or cmd + shift + ] (move right) ( W

Thread vs Service in Android - ABNHive

The thread is part of your program functionality that can run in parallel with the main application execution process (or thread). It runs withing a process. The process may contain only, and that’s rare one thread and mostly contains multiple threads. Threads share the same resources and memory. Creating new thread need very less work that creating a new process. Use a Thread when The app is required to be visible when the operation occurs. background operation is relatively short running (less than a minute or two) the activity/screen/app is highly coupled with the background operation, the user usually 'waits' for this operation to finish before doing anything else in the app. Using a thread in these cases leads to cleaner, more readable & maintainable code. That being said its possible to use a Service( or IntentService). Use a Service when The app could be invisible when the operation occurs (Features like Foreground service could help with operations b

Content Providers in Android - ABNHive

Content providers - The name indicates all.  It provides contents or data to applications. In Android, Content Providers are used to sharing data between the applications.  The android.content Package The android.content package contains classes for accessing and publishing data. The Android framework enforces a robust and secure data sharing model. Applications are not allowed direct access to other application’s internal data. Two classes in the package help enforce this requirement: the ContentResolver and the ContentProvider. Functions in a Content Provider How to ensure smooth database functionality? Make a Content Provider:- This will be a full Content Management System with methods to add, update, delete new data. It will establish a unique address (URI) for the databases in your application. Use a Content Resolver:- Given the address (URI) it will resolve the particular address and ask the associated database living there. (Content Provider). All method

Android VS Other Mobile Operating Systems - ABNHive

iOS iOS, an operating system from Apple, was originally developed for the iPhone. Later it was extended to support iPod Touch, iPad and Apple TV. Apple’s App Store contains more than 500,000 applications and boasts more than 25 billion downloads collectively. It holds the reputation of intelligent UI creator which is based on the concept of direct manipulation, using multi-touch gestures. Android Android is a Linux based mobile operating system developed by the Open Handset Alliance led by Google. Android boasts large community of developers writing applications extending the functionality of the devices. It has 450,000 apps in its Android Market and download exceeds 10 billion count. BlackBerry OS BlackBerry OS is developed by Research In Motion (RIM) for its line of smartphones. This operating system is known for its native support for corporate e-mail through MIDP allowing complete wireless activation and synchronization with Microsoft Exchange and Lotus Do

Broadcast receivers in Android - ABNHive

It responds to system-wide broadcast announcements. It used to display a persistent icon in the status bar of the device, vibrate, play a sound, flashlights, etc. to indicate to the user that something significant has happened in the background. System Generated Events The following table lists a few important system events. android.intent.action.BATTERY_CHANGED - Sticky broadcast containing the charging state, level, and other information about the battery. android.intent.action.BATTERY_LOW - Indicates low battery condition on the device. android.intent.action.BATTERY_OKAY - Indicates the battery is now okay after being low. android.intent.action.DATE_CHANGED - The date has changed. android.intent.action.REBOOT - Have the device reboot. android.intent.action.BOOT_COMPLETED  - This is broadcast once after the system has finished booting. android.intent.action.BUG_REPORT  - Show activity for reporting a bug. android.intent.action.CALL  - Perform a call to someo

Services in Android - ABNHive

A service is a component which runs in the background without direct interaction with the user.  A service extends the base class Service . Services run with a higher priority than inactive or invisible activities and therefore it is less likely that the Android system terminates them for resource management. The only reason Android will stop a Service prematurely is to provide additional resources for a foreground component usually an Activity. When this happens, your Service can be configured to restart automatically. You can start a service if it is not running using Context.startService(), connect (bind) to a running service using Context.bindService(), and communicate with the running service through an interface that the service exposes. Each service class must have a corresponding <service> declaration in the AndroidManifest.xml file for its package. Types of Services Bound Service Service which call indefinitely in between activity. An Android component may b

Essential Guide to Setting up Emulators- ABNHive

An Android emulator is an Android Virtual Device (AVD) that represents a specific Android device. You can use an Android emulator as a platform to run and test your applications on your PC. Installing Emulator on PC Steps are given below Open SDK Manager from Android Studio, click Tools > SDK Manager. Click SDK Tools section Click to tick Android Emulator and Intel x86 Emulator Accelerator - HAXM Installer (If available) Click OK Button Wait to complete download It will automatically download Android Emulator Creating AVD After downloading the Emulator we need to Create AVD (Android Virtual Device).  Click  Tools > AVD Manager. Click Create New Virtual Device Icon Now choose device  If a download option is there, just click to download Device Image Configure Device Now Android Studio creates AVD Click the green icon to run Emulator - Aswin Bhim Nath

Activities in Android - ABNHive

An activity represents a single screen with a user interface. For example, a simple activity might present a set of choice buttons. Activities work together to form user experience in the app. For example, clicking a button on the first screen might replace that screen with another screen containing other widgets, a web page, a movie, or text information. Activities are typically created by extending the Android class Activity. Activity class automatically takes care of creating a window for you in which you can place your user interface (UI) with the method setContentView(View).  Methods in Activity Class. Every Activity has Methods which we can override.  onCreate(Bundle) initializes the activity. Two of the most important methods at your disposal here are setContentView(View) with a layout resource defining your UI, and findViewById(int), to retrieve the widgets in that UI that you need to interact with programmatically. onPause() is where you deal with housekee

Android Application Components Activities, Services, Broadcast Recievers, Content Providers - ABNHive

Application components are the essential building blocks of Android app development.  Each component is an entry point through which the system or a user can enter your app. There are 4 types of components in android Activities Services Broadcast receivers Content providers Let's dive into the deep.  Activities This is a component that represents a single screen with a user interface or simply an entry point for interacting with the user. Example, an email app might have one activity that shows a list of new emails. Activities work together to form a cohesive user experience in the app. For example, clicking a button on the first screen might replace that screen with another screen containing other widgets, a web page, a movie, or text information. Activities are typically created by subclassing (extending) the Android class Activity.  click here   to know more about Activity. Services This runs in the background to perform work for remote processes or

Begin to code the First android app - ABNHive

We discussed android a lot in previous articles. Now let's begin to code. Before that, we need to know about Android Studio. Android Studio is the official Integrated Development Environment (IDE). Before reading this you should read this  portion. Why we need the Android studio A flexible Gradle-based build system A fast and feature-rich emulator A unified environment where you can develop for all Android devices Instant Run to push changes to your running app without building a new APK Code templates and GitHub integration to help you build common app features and import sample code Extensive testing tools and frameworks Lint tools to catch the performance, usability, version compatibility, and other problems C++ and NDK support Built-in support for Google Cloud Platform, making it easy to integrate Google Cloud Messaging and App Engine Now Download Android Studio and other tools. I mentioned about tools in  here . Let's create a HelloWorld Applicat

Points to Remember Before Coding First Application - ABNHive

We need to remember some points before code Android Apps. The points are given below. Package - A package is a namespace. A package is essentially the directory (folder) to which source code belongs. Normally, this is a directory structure that uniquely identifies your application; such as com.helloworld.app. Then you can create packages within your application package that separates your code; such as com.helloworld.app.ui or com.helloworld.app.data. It basically lets you have two classes named Employee if they are in different packages. Class -  A class is a blueprint for creating objects in class-based object-oriented programming; you should learn the basics of OOP and understand what an object is, what a class is, what is inheritance, polymorphism, encapsulation before learning anything else about Java. The basic structure for one of the Android project-  Let's Explore each file AndroidManifest.xml : This is the Android definition file. It contains informati

Lets Discuss about Native, Hybrid, Web Applications - ABNHive

We can see a lot of Android applications in App stores. But, do you know about different categories of Android applications? Applications are classified in 3 categories and sub-categories as follows.  Native applications iOS apps Android apps Windows apps Hybrid applications Xamarin apps Angular Js apps React Native apps Ionic apps Web applications App responsive to mobile Work along with website Supportive of any device Native applications  These applications are developed with single mobile operating systems like ios, android or windows these applications cannot be used on a platform other than their own in which application is been developed and design. The user will be not able to use ios application in android or android application in windows. Advantages of these applications are that they are highly responsive with accurate UI. Native applications can be downloaded from their web stores with meeting users end. These applications which

Code on your smartphone - Useful Apps To Learn Programming using Smartphone - ABNHive

This article for those who would like to code with a smartphone. The following apps help you to code  on your smartphone.  Programming is becoming one of the most important skills in the 21st century. If you are planning on building your own software program then you will need some necessary tools to get good working software. Millions of people from around the world use smartphones, but they didn't know they can code on their mobile too. I recommend the apps given below after installing and testing. And, when you want to code, all the universe conspires in helping you to achieve it AIDE — Android IDE — Interactive teaching through examples. They have a Supportive Google plus community to help you. Anacode IDE — Helps you to code in HTML,CSS,java,android, JavaScript,PHP,c++,css. Easy to compile and run. Code Editor — Currently supports coding in the following programming languages: ActionScript, C, C++, C#, CSS, Haskell, HTML, Java, JavaScript, Lisp, Lua, Markdow

Talk about Ingredients before cooking in Android, the complete android tools - ABN Hive

We should know about the ingredients before cooking. Besides, we need to know about tools before developing android applications. Let's talk about it. Android Studio  This is the IDE (Integrated Development Environment) to make Android Applications. Android Studio provides the fastest tools for building apps on every type of Android device. It contains tools for development, debugging, testing, and performance that make it faster and easier to develop apps like these, Visual Layout Editor APK Analyzer Fast Emulator Intelligent Code Editor Flexible build System System requirements Windows Microsoft® Windows® 7/8/10 (32- or 64-bit) 3 GB RAM minimum, 8 GB RAM recommended; plus 1 GB for the Android Emulator 2 GB of available disk space minimum, 4 GB Recommended (500 MB for IDE + 1.5 GB for Android SDK and emulator system image) 1280 x 800 minimum screen resolution Mac Mac® OS X® 10.10 (Yosemite) or higher, up to 10.13 (macOS High Sierra) 3 GB RA

Let's Deep dive into Android - ABN Hive

Android is a wide range platform. Most people use Android devices.  Now we know that android development is continuously growing.  So,  building android apps give you revenue and status... Etc. Little History I know history classes are a little bit boring. But without knowing history you can't make history. Andy Rubin  founded Android Incorporation in Palo Alto, California, the United States in October 2003. The key employees of Android Incorporation are  Andy Rubin, Rich Miner, Chris White  and  Nick Sears . Android was originally intended for the camera but shifted to smartphones later. In 17th August 2005, Google acquired Android Incorporation. Since then, it is in the subsidiary of Google Incorporation. In 2008, HTC launched its first Android mobile. Introduction to Android Android is an open source and Linux-based operating system for mobile devices such as smartphones and tablet computers. Android is developed in the Android Open Source Project (AOSP).