Skip to main content

Posts

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) o...

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). A...

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...

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 m...

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