Monday, July 23, 2012

What is design pattern ? What are good design patter in Android ?


What is design pattern?  What is design pattern in Android?

In software engineering, a design pattern is a general reusable solution to a commonly occurring problem within a given context in software design. A design pattern is not a finished design that can be transformed directly into code. It is a description or template for how to solve a problem that can be used in many different situations. So patterns are formalized best practices that you must implement yourself in your application

Friday, July 20, 2012

What is the difference between minSdkVersion, maxSdkVersion and targetSdkVersion


  • android:minSdkVersion — Specifies the minimum API Level on which the application is able to run. The default value is "1".
  • android:targetSdkVersion — Specifies the API Level on which the application is designed to run. In some cases, this allows the application to use manifest elements or behaviors defined in the target API Level, rather than being restricted to using only those defined for the minimum API Level.
  • android:maxSdkVersion — Specifies the maximum API Level on which the application is able to run.Important: Please read the <uses-sdk> documentation before using this attribute.


<uses-sdk android:minSdkVersion="integer" 
          android:targetSdkVersion="integer"
          android:maxSdkVersion="integer" />

Tuesday, July 17, 2012

Preventing status bar expansion - Disable Notification Bar

Use your phone for just about any length of time, and you'll notice that little icons pop up and sit on the top-most gray bar on your phone. This is known as the Notification Bar, though it's sometimes referred to as the "Status Bar" or "System Status Bar" in Android developer documents

Here, we will see, whether we can play with this status bar or not.
Is there anyway to prevent users from sliding the status bar (expand) or collapsing back?
I'm trying out a lockscreen replacement and seems like it's a must-have feature. Is there any possible way to do it without requiring root privileges?

Answer is Yes, it possible in some how. - 

Session Management in Android

Wanted to maintain Session, i.e. Session Management in Android.

This has nothing to do with Android. It has everything to do with Apache HttpClient, the library you are using for HTTP access.
Session cookies are stored in your DefaultHttpClient object. Instead of creating a newDefaultHttpClient for every request, hold onto it and reuse it, and your session cookies will be maintained.
Generally, in Java HttpURLConnection you can set / get a cookie this way (here is the whole connection process). The code below is in my ConnectingThread's run(), from which all the connecting activity classes inherit. All share common static sCookie string which is sent with all the requests. Therefore you can maintain a common state like being logged on / off: