Android Contain ListView (Without Scrollbars) In a ScrollView With Other Views

When a ListView is put inside a ScrollView with (or without) other views it takes as much space is available in the ScrollView. So let’s say there are three elements like this:

Continue reading “Android Contain ListView (Without Scrollbars) In a ScrollView With Other Views”

Android Push Notifications with Parse.com

Update: Parse is shutting down. So you should start migrating.

If you want to send messages upstream and downstream from your Parse backend to your app and vice-versa then thankfully Parse does allow you to do that. Parse allows you to send unlimited push notifications to 1 million unique recipients (devices). Then they charge $0.05 per 1000 recipients extra. That’s awesome!

Continue reading “Android Push Notifications with Parse.com”

Android Push Notifications with PubNub Data Streams (via GCM)

PubNub is a SaaS platform that lets us build realtime applications fairly quick by taking implementing websockets and a neat pub/sub API based model along with several other nice features. It’s supported across all sorts of platforms that you can think of like PHP, Ruby, Python, Android, iOS, Java, embedded systems, etc. I’ve covered how to setup it’s Android SDK and the basic usage before. In this tutorial I’d like to cover how we can use it to send Push Notifications via its own REST APIs as well as Google Cloud Messaging (GCM). I’ve already covered Android messaging (showing up as Notifications) via GCM before.

Continue reading “Android Push Notifications with PubNub Data Streams (via GCM)”

Android Push Notifications with Google Cloud Messaging

We’re all familiar with the notifications that we receive from various apps on Android (even other platforms like iOS) that keeps us informed about relevant and timely events that occur in the pertaining app. Like new chat messages from WhatsApp or Emails from Gmail or a new friend request on Facebook. They’re like alerts for any important events occuring inside the app when the user hasn’t or is not using it which is sort of obvious as one won’t keep an app open and stare at it for good.

Continue reading “Android Push Notifications with Google Cloud Messaging”

Understanding Android Pending Intents

PendingIntent is basically an object that wraps another Intent object. Then it can be passed to a foreign application where you’re granting that app the right to perform the operation, i.e., execute the intent as if it were executed from your own app’s process (same permission and identity). For security reasons you should always pass explicit intents to a PendingIntent rather than being implicit.

Continue reading “Understanding Android Pending Intents”

Understanding Android Broadcast Receivers

A BroadcastReceiver is an Android app component that responds to system-wide broadcast announcements. Imagine an event like external power being connected/disconnected from the device, screen turning on/off, battery getting low or picture captured. All these events originate from the system. Infact apps themselves can also initiate broadcasts – for example the SMS app broadcasting that an SMS has being received and let other apps know about this event so that they can trigger some action. Unlike Activities broadcast receivers do not have any user interface but may create a status bar notification. It is intended to do minimal amount of work and can delegate hardcore jobs to Services. It receives an Intent object, so if you’ve read my previous articles on Intents and Intent Filters you’ll have an easy time learning it.

Continue reading “Understanding Android Broadcast Receivers”

Understanding Android Intent Filters (Receiving Implicit Intents)

Intents sends signals to the Android system telling it that some action needs to be performed by another component (activity, services, broadcast receivers) in the same app or a different app. The system starts resolving which component in which app is responsible to handle this event that just got triggered. Let’s see a simple example of an implicit intent that opens a webpage URL in the browser.

Continue reading “Understanding Android Intent Filters (Receiving Implicit Intents)”