Android Push Notifications using GCM

“Google Cloud Messaging for Android (GCM) is a service that helps developers send data from servers to their Android applications on Android devices”. Using this service you can send data to your application whenever new data is available instead of making requests to server in timely fashion. Integrating GCM in your android application enhances user experience and saves lot of battery power. Google Cloud Messaging GCM API We can use GCM as a notification engine. On an event it will send a notification to an android application and vice-versa. A notification is a small piece of information. Using GCM, maximum 4kb of payload can be sent in a notification. For now GCM is a free service – lets use responsibly 🙂 Android App can receive the message from Google cloud messaging server (GCM) even if the app is not running via Intent broadcasting (our example app will demonstrate this). Manifest Let’s start with our manifest. We’ll want to add some permissions under the manifest markup. <uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.WAKE_LOCK" /> <uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" /> <permission android:name="your.package.name.permission.C2D_MESSAGE" android:protectionLevel="signature" /> <uses-permission android:name="your.package.name.permission.C2D_MESSAGE" /> Next step is to register our Broadcast Receiver and Service. You should already have that last line in your manifest if you added the google play services properly. <receiver android:name=".GcmBroadcastReceiver" android:permission="com.google.android.c2dm.permission.SEND" > <intent-filter> <action android:name="com.google.android.c2dm.intent.RECEIVE" /> <category android:name="your.package.name" /> </intent-filter> </receiver> <service android:name=".GcmIntentService" /> <meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" /> Broadcast Receiver We are going to start by creating a new class which extends WakefulBroadcastReceiver. public class GcmBroadcastReceiver extends WakefulBroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { ComponentName comp = new ComponentName(context.getPackageName(), GcmIntentService.class.getName()); startWakefulService(context, (intent.setComponent(comp))); setResultCode(Activity.RESULT_OK); } } The...

Andriod Mobile app memory utilisation testing

With wider adoption of smartphones and continuous innovation in Mobile technologies, business are providing core capabilities on devices. Number of apps and media running on the Android phone, started creating memory utilization challenges on the mobile device. So there is a need of knowing the memory utilized by android app in our mobile device. As part of testing mobile apps for our clients, we come up with best testing practices. This blog illustrate practical approach of checking memory utilized by android app on mobile device. We are using memory monitoring tool from the android studio for checking memory utilization. Memory Monitor 1. It shows available and used memory as they both change over time for your app in a graph, with dips indicating Garbage Collection (GC) events. 2. Also provides a quick way to test whether app slowness might be related to excessive GC events. 3. Provides a quick way to see whether app crashes might be related to running out of memory. 4. It runs live on your android application and updates about once a second. 5. Helps quickly identify the potential of memory leaks. Memory Monitor Walk-through This walkthrough shows the basic usage and workflow for the Memory Monitor tool in Android Studio. Memory Monitor reports in real-time how your app allocates memory. Prerequisites for Memory monitor A mobile device with Developer Options enabled. An Application with USB Debugging enabled. Steps to working with Memory monitor 1. If you’re using a mobile device, connect it to your computer. 2. Open your application in Android Studio, build the source, and run it on your device or emulator 3....

Mobile technologies and happening disruption

The history of technology is defined by series of disruptions that have fundamentally challenged IT landscape. Smartphone and devices are challenging existing business processes and creating opportunities to reinvent for better. Mobility is at the centre stage for helping information to cross the boundaries. With M2M technologies Mobile apps becoming increasingly sophisticated with power of network, ability to analyse enormous data for quality and bringing core capability to device. According to a recent McKinsey CIO survey, tablets could replace up to 30 percent of laptops in the coming years, which is happening and now devices start playing smart roles in it’s bounded context. Mobile opportunities for businesses Customers and businesses are already pushing for the mobile transformation and generating number of business cases. These are categorised into: Communication and collaboration Mobile technologies is enhancing the way employee interact with other employees or customer. This is allowing businesses to engage their customer in fundamentally different ways. For example shopping on the way, delivering content based on predictive analysis. Access to core-business capabilities Every business has core capabilities that help deliver business value. Mobile technologies allows worker or customer to take advantage of core capabilities. Providing mobile access to CRM, ERP or executive dashboard improved enterprise productivity and help management make data driven decisions. Machine-to-Machine sensors By building intelligent sensor networks (e.g., real-time asset management using RFID-tagged cases), enterprises are also improving productivity. Key success factor in deploying mobile solution for your business: Business Value-centric solution Enabling mobile solution for enterprise is challenging. Businesses should identify and focus on areas that create real value. Segmenting the core capabilities and identifying the...

Internet of Things (IoT) : Future of Technology and Innovation

“IoT is not a technology initiative. It is all about business process improvement.” Internet of Things (IoT) is a network of unique physical objects that contain embedded technology to communicate, sense, analyze, and/or interact with their internal state or external environment. One of the well known Transport Company Uber uses geo-fencing technology as defensive measure. NCR based two wheeler company tracks its fleet of trucks across the length and breadth of the country using GPS technology. Another Chennai based auto manufacturer toying up with the thought of launching connected vehicle. The company also tracks pollution levels and productivity across its shop floors using connected devices. Technology companies and hospitals are talking about how doctors will be able to monitor blood pressure, sugar levels of diabetic patients real-time in the near future. That’s what the Internet of things (IoT) is all about. After surpassing the human population on the planet in 2011, internet connected devices are expected to number between 26 billion and 50 billion globally by 2020.These devices, could only be thought to be mobile phones, laptops, desktops, now include ATM machines, gas pipelines, street lights, transportation vehicles and even the soil that used for agriculture. This highly interconnected world is something that the industry calls Internet of Things. 5 things you should know about the future of Internet of Things (IoT): As per market research firm Gartner, the total revenue generated from the IoT industry would be $300 billion. It has been assumed that India would have a share of 5-6% of global IoT industry. IoT industry that the Indian government expects to cross $15 billion by 2020. The...