HMKCode has released a new simple, easy and elegant jQuery tutorial. Try it here
How to center a view or its content e.g. TextView or Button horizontally and vertically? layout_gravity can be used to position a view in the center of its parent. While gravity attribute is used to position view’s content e.g. “text” in the center of the view.
Google Cloud Messaging for Android (GCM) is a push-notification-like service freely provided by Google. Simply, it allows you to send data from one-end “we will call it a GCM server” to GCM clients e.g. Android app.
This service can be used to send notifications or messages containing up to 4Kb of payload data. The GCM service takes care of messages queueing and delivery to the target application. GCM is completely free no matter how big your messaging needs are, and there are “so far” no quotas.
Android Debug Bridge (adb) lets you communicate with an emulator or connected Android-powered device through a command line tool. You can use
push commands to copy files to and from an emulator/device to your development machine.
Here is a simple example of designing one of the most common needed screen (Sign In&Up). Of course, this is not the only way to design such screens but the objective here is to learn some tips and tricks.
Learning by example is my best way to learn new stuff. Here we will see a good example of designing Android “sing-in with social networks” screen which covers many designing “tips & tricks” that you will definitely need when designing your real-life app.
HTTP AsyncTask is a commonly needed function in most Android app. So it is better to have a generic and reusable piece of code that can take care of the HTTP AsyncTask process whenever you need it. This will save your time and make your business code cleaner. Here we will see a suggested way to build such generic and reusable code.
To send notification messages to Android devices you need first to send a POST request from your application to Google Cloud Messaging (GCM) service instructing it to send the notifications. Here we will see how to send POST request to GCM from Java “desktop” application.
When sending a message from your own HTTP server to Google cloud messaging server, you need to authenticate using Server API Key. This API Key can be created from the Developer Console. The Key will be appended into the POST request headers as a custom header. Read more about Authentication