Showing posts from February, 2013


 SurfaceView class provides dedicated drawing surface.Surface is Zordered. It punches a hole in the window to allow the surface to be displayed. SurfaceView takes care of placing the view at correct place. getHolder() - Access to the surface is provided through SurfaceHolder interface which can be retrieved by calling getHolder().

Implement SurfaceCreated, SurfaceDestroyed , SurfaceChanged to discover when the surface is created, changed, destroyed.

Here is the example for SurfaceView class

public class Surface

public class SurfaceExample extends SurfaceView { public SurfaceExample(Context context, AttributeSet attrSet) { super(context, attrSet); } }
Download Source codepackage com.srinivas.hellomr;


import android.os.Bundle;
import android.view.SurfaceHolder;
import android.view.SurfaceView;
import android.view.Window;
import android.hardware.Camera;
import android.view.WindowManager…


Post your query here and get fastest solution

HttpClient post in Android

To post the data to the server, to get the data from the server which is stored in remote database, we can use HttpClient for webservice requests.
 call HttpClient ,
HttpClient  client = new DefaultHttpClient();
Here is the example for HttpClient for posting the data, getting response from the server.

public class MainActivity extends Activity {
    TextView tv;
    String text;
    Button b;
    DefaultHttpClient client; 
    protected void onCreate(Bundle savedInstanceState) {
    tv     = (TextView)findViewById(;
     text     = "";
     public void callWebService(View webService)
      try {
        } catch (JSONException e) {
            // TODO Auto-generated catch block
  public void postData() throws JSONException{ 
        // Create a new HttpClient and Post Header
        client = new D…

Android Developers -Freshers and Experienced

Picon Infotech Pvt Ltd            0-2 yrs            Android developer                   Click here to apply

OKIT Pvt Ltd                               0-2 yrs               Android Developer                    Click here to applySmart Utility Systems           0-1 yr                Android Developer                 Click here to applyPennywise software               0-2 yrs               Android Developer                  Click here to applyMultiplex Systems Private Limited               Iphone Developer                      Click here to apply

HP hiring Software developers (freshers)


Bachelors or Masters degree in Cse, It


0-2 yrs


Good analytical and problem solving skills.
Good knowledge of design of software applications.
Good communication skills.

Primary Location: 

Click here to apply

MAQ hiring software engineers

Job location: Mumbai, Hyderabad

Position: Software Engineer

Experience:  Freshers (0 to 1 yr)

Event date: 09 march 2013


2012 batch Btech

Graduates with PH score

Job Description:

Web app development using C#, SharePoint, Microsoft SQL Server,

XML Webservices

Business Intelligent app testing

Click here to apply

Dell India hiring freshers

Position:  Software Developer Analysts

Location:  Bangalore

Experience: Freshers

Job Code: 130004QE

Job Description:

To resolve Netcool Change requests
Obtain requirements from clients
delivering commited change requests with all quality.

Click here to apply

WebView in Android

WebView is a class which is an extention of View class. Using Webview, we can display webpages in the mobile browser.

To add webview to your application, declare internet permission in manifest file and add WebView to xml.
To load webpage in WebView, use loadUrl

WebView wb=(WebView)findViewById(;

You must enable javascript in your webview to load javascript in the page.

To bind interface between Javascript code and android code, then use
        webview.addJavascriptInterface(new WebAppInterface(this), "Android");

To store user data in the browser, we have to use cookies, so that the browser data it does not share.
android.webkit.CookieSyncManager  class to manage all cookies. To use this, 1st create one instance, cookieSyncManager.createInstance(context); setup sync call to start cookieSyncManager.getInstance().startSync(); to stop cookieSyncManager.getInstance().stopSync(); to get sync instantly,

Java Developers Jobs

Java Developers in MNC

experience: 2 yrs
 email your resumes to

for more jobs apply here

SancroSoft USA inc
4944 Sunrise Blvd, Suite B-4, Fair Oaks,
CA 95628,
Phone: 718-360-4561

InteractCRM  hiring Java ProfessionalsJob Dec:

Work in product devel team to build  Contact Center Solutions for our clients.Deliver work  using OOAD methodologies , provide technical insights to the team.Design, coding & testing of Modules and components assigned.

Desired Profile:

3 - 4 years hands on Java / J2EE & web services develop exp.  exposure to all software development life cycle. analytical, logical & communication skills. email ur resumes to:

Loaders in Android

Loaders providing Asynchronous loading data into an activity or fragment.When the data changes, it automatically update the new results.It automatically reconnect last loader when its recreated. So, no need to re query.

Starting the Loader:

we can initilize loader in onCreate() method.

getLoaderManager().initLoader(0,null, this);

initLoader takes the following parameters

unique id. In the above unique id is 0.
argument to supply to loader at construct (optional).

LoaderManager calls to report loader events.

Internal Flow of Threads or Thread Model

whenever we write multi threading application, it contains multiple flow of controls.
All the flow controls follow the sequence steps at execution time.

Java programs starts execution by loading .class file

JVM creates a background thread and will reside in main.

Background thread creates various foreground threads and dispatches to their run to execute and result back to background and will handover to garbage.
Background thread gives back to program.
JVM collects background thread and will handover to Garbage collector.
Java program stops its execution.

Difference between StartActivityForResult, startActivity

Many of them  have confution about startActivity and startActivityForResult() methods.
startActivity() is to start another activity
StartActivityForResult() is to receive a result. The activity has to return a result.
When it returns a result, it sends as another intent object and activity recives result in onActivityResult() and here we can handle.
We need to pass an integer arg to startActivityForResult() method. So that request code will identifies the request.
When you get the result intent, callback provides the same request code to identify the result.

see this example:
  Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
        startActivityForResult(intent, 1);
    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
        if (requestCode == 1){           

Tabs like with ActionBar

TabActivity is depreciated  in Api 13. Tabs are presented in latest versions with ActionBar.

So, prefer to not to use depreciated classes and methods. So use latest classes and methods.

Here is the simple example of creating Tab like activity using fragments.

package com.srinivas.mobengineers;

import android.content.Context;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.os.Bundle;
import android.widget.Toast;

public class MobEngineersActivity extends Activity {
    public static Context appContext;

    /** Called when the activity is first created. */
    public void onCreate(Bundle savedInstanceState) {
        appContext = getApplic…