Ivan's Blog

Lets learn new things!

Localization: Convert English Number to Bangla Number

To support localization in an application, We need to store all primary text translations into files or database. Every popular framework or platform like Android, J2EE, PHP frameworks and CMS support multi-language localization. Most of these are based of simple configuration. Most common approaches used by these platform or frameworks are: XML based localization string files and Database driven: tag based data structure.

Accessing all images using MediaStore: An android provider

As an android developer, we need to access devices images for various purpose. To access images, android sdk provide a build in content provider, called MediaStore. Here I will demonstrate how we can use MediaStore to access not only all photos but also map them into their corresponding albums.   1st off all we will need external storage read permission. … Read More

Android: Use HttpURLConnection instead of deprecated Apache module: HttpClient/HttpResponse

As Android deprecated Apache module like HttpClient, HttpResponse, we can use HttpURLConnection. Here is some code sample: try { URL url = new URL(onlineUrl);//use a proper url instead of onlineUrl HttpURLConnection connection = (HttpURLConnection) url.openConnection(); connection.setRequestProperty(“User-Agent”, “”); connection.setRequestMethod(“GET”);//we can use POST instead of GET method also. connection.setDoInput(true); connection.connect(); InputStream inputStream = connection.getInputStream(); if (inputStream != null) { BufferedReader bufferedReader = … Read More

[NFC]NFC TAG data reading

NFC TAG data reading: There are different type of data can be stored in NFC tag. Data can be: TNF = TNF_WELL_KNOWN AND RECORD = RTD_TEXT/RTD_URI TNF = TNF_ABSOLUTE_URI TNF = TNF_MIME_MEDIA TNF = TNF_EXTERNAL_TYPE Here is android code example where shows how to read the data from tag. [sourcecode language=”java”] public void test(Intent intent){     Parcelable[] data = intent.getParcelableArrayExtra(NfcAdapter.EXTRA_NDEF_MESSAGES); … Read More

How to use msgpack-java in eclipse

1. 1st install in Maven in windows Follow: this link http://www.mkyong.com/maven/how-to-install-maven-in-windows/ If “mvn –version” this command don’t work then run this “mvn -x –version” 2. Then download msgpack-java zip from this github https://github.com/msgpack/msgpack-java Unzip that folder. 3. Now go the downloaded folder of msgpack-java from command line(cmd) 4. Then follow these steps: https://github.com/msgpack/msgpack-java 5. After import the msgpack in Eclipse, … Read More

A brief discussion about most common object of Java: String, StringBuffer and StringBuilder

String, StringBuffer, StringBuilder are belongs to java core library : java.lang. All these three are implements of CharSequenceInterface. When creating a String object, it creating a string that can not be changed. So when its changing a new string object is creating. This is actually called string immutable(unchanging over time or unable to be changed). String’s or object’s toString() is … Read More