How to put some special math symbols in TextView, EditView or other Android UI element.

Here the screenshot with special math symbols To make this you need just put HTML codes of with this symbols in TextView or other Android widget. Here the code:

How to include Facebook Android SDK in project as maven module

This post will be usefull if you have Android maven multimodule project and want to include Facebook Android SDK  in your project as module.

How do this?

As you see here https://github.com/facebook/facebook-android-sdk the Facebook SDK used not as maven module.

Below you can download source code of Android project

To do this you need:

1. Download the Facebook Android SDK from github.

2. Add Facebook Android SDK lib project in your workspace near other modules of your maven project. Look at screenshot below:

(more…)

How to implement lazy loading for markers on Google Maps in Android.

If your objects which you want to show on the Google Maps in Android have different markers. You need to use lazy loading for markers.

How to do it? It’s very easy. Just use AsyncTask . 

Below you can download source code of Android project.

When you start application you can see Google Maps with red default markers. When custom marker loaded the custom marker will replace default marker and update map overlay.

To see map you need specify your own Google Maps API Key in MapView  (see main.xml file)

< ?xml version="1.0" encoding="utf-8"?>
<linearlayout xmlns:android="http://schemas.android.com/apk/res/android"
	android:orientation="vertical"
	android:layout_width="fill_parent"
	android:layout_height="fill_parent">
	<com .google.android.maps.MapView 
		android:id="@+id/mapView" 
		android:layout_width="fill_parent" 
		android:layout_height="fill_parent"
		android:clickable="true" 
		android:apiKey="YOUR_API_KEY"></com>
</linearlayout>

Other info you can see in the code. It is simple to understand. Please, add the questions in comments.

Here code of the AsyncTask class

(more…)