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

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