I make my own arm image on debian x86 in this way:

apt-get install debootstrap 
dd if=/dev/zero of=debian.img seek=749999999 bs=1 count=1 
mke2fs -F debian.img mkdir debian 
mount -o loop debian.img debian 
debootstrap --verbose --arch armel --foreign wheezy debian http://ftp.de.debian.org/debian 

Then transfer it to to the arm phone, and using an android term emulator I chroot and debootstrap a second stage etc... The linux image is quite nicely useable by chrooting from the android term emulator. But I would like to know if I can use qemu-arm from my x86 machine with that image and how. Because the image is not bootable I would try something like that:

qemu-system-arm -m 1024M -M versatilepb -kernel {which kernel to use here? I tried to compile an arm kernel with gcc-arm-eabi...} -initrd {which init?} -append "root=/dev/ram" {?} -hda debian.img -no-reboot

I am not looking to make a bootable image (in the way described here, a netboot: https://gist.github.com/bdsatish/7476239) but to be able to attach the image created above to a fully running qemu). Help and suggestion appreciated.

I'm stuck again need help from you guys. I'm getting NetworkOnMainThreadException exception at getting response from my service. I'm still learning Android so don't know the nutty gritty of threading in Android. Any help with explanation and working example would be great. Thanks in advance, you guys are awesome help.

package com.abcd.myapp;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;

import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.HttpStatus;
import org.apache.http.StatusLine;
import org.apache.http.client.ClientProtocolException;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.DefaultHttpClient;

import android.util.Log;

public class RequestManager {

    String baseUrl = "http://dev.mysite.com/Service/MyService.svc/";

    public String GetResponse(String url) {
        String responseText = "";
        // Create a HTTP client 
        HttpClient httpClient = new DefaultHttpClient(); 
        HttpGet httpGet = new HttpGet(baseUrl + url);

        try {
            // get the response 
            HttpResponse response = httpClient.execute(httpGet);
            StatusLine statusLine = response.getStatusLine();
            if (statusLine.getStatusCode() == HttpStatus.SC_OK) {
                HttpEntity entity = response.getEntity();
                InputStream is = entity.getContent();               
                BufferedReader reader = new BufferedReader(new InputStreamReader(is, "iso-8859-1"), 8);
                // Create a buffer 
                StringBuilder sb = new StringBuilder();

                String line;
                while((line = reader.readLine()) != null) {                 
                    sb.append(line + "\n");

                responseText = sb.toString();
                // do something with response 
            } else {
                Log.d("RequestManager", "Error fetching data. Server returned status code: {0}"+ statusLine.getStatusCode());
                // handle bad response
        } catch (ClientProtocolException e) {
            // handle exception
        } catch (IOException e) {
            // handle exception
        return responseText.toString(); 

me and my friend had a big fight yesterday still i confused which one i should use.please suggest me ?

i have one activity with 2 fragment and 2 screens.

the first screen is activity screen main.xml

in Activity


the seconds screen contains two fragment (Basically one fragment which has another one(ListFragment with it)

public class MainFragment extends Fragment {

public void onCreate(Bundle savedInstanceState) {

NewListFragment newListFragment = new NewListFragment();

      fm.beginTransaction().add(R.id.font_list_fragment, fontListFragment).commit();

       NewListFragment.OnNewSelectedListener onNewSelectedListener= new         

        NewListFragment.OnNewSelectedListener() {
    public void onListSelected(int position) {


so i am sending value from Listner(NewListfragment)-->MainFragment---> Activity

he suggested me to use listview to send value MainFragment ---> Activity

Note i am using action bar menu to instantiate the MainFragment

public boolean onOptionsItemSelected(MenuItem item) {

    int id = item.getItemId();
    switch (id){
              case R.id.second:
           getFragmentManager().beginTransaction().add(R.id.container, new MainFragment()).addToBackStack("").commit();


is it that much bad to use listfragment inside the fragment? and getting value from by hierarchy

I have a button when i press the Button the value of the button should be stored in a variable temporarily.And the button should remain pressed when i moved to another position using two dimensional array

Android cannot get data when I include function.php file.But Android get data when I remove file include code in current php file.How to solve this error.I wanna use some function in function.php file.So I must use include code to call function.php.

I've no idea.is it android or php fault?

My PHP version : 5.3.10 apache version : 2.2.21

My android code:

 HttpClient client = new DefaultHttpClient();
        HttpConnectionParams.setConnectionTimeout(client.getParams(), 500000);
        HttpConnectionParams.setSoTimeout(client.getParams(), 500000);
        HttpUriRequest request = new HttpGet(CategoryAPI);
        HttpResponse response = client.execute(request);
        InputStream atomInputStream = response.getEntity().getContent();
        BufferedReader in = new BufferedReader(new InputStreamReader(atomInputStream));

        String line;
        String str = "";
        while ((line = in.readLine()) != null){
            str += line;

        // parse json data and store into arraylist variables
        JSONObject json = new JSONObject(str);
        JSONArray data = json.getJSONArray("data");

        for (int i = 0; i < data.length(); i++) {
            JSONObject object = data.getJSONObject(i); 

            JSONObject feed = object.getJSONObject("Feeds"); 

            FeedItem.allFeedItemsList.add(new FeedItem(Integer.parseInt(feed.getString("id")), feed.getString("name"), feed.getString("post_img"), feed.getString("post_description"), feed.getString("userimage"), feed.getString("post_date"), feed.getString("post_title")));   

Anyone can help??????????

I have an app that show categories of TV shows,each of which has its own image, when click on a category the app will move to another activity that uses a GridView to display all TV shows of that category (TextView & ImageView). That is all OK , but now I want to display that category image along with the GridView like the following image:

how I can implement a custom grid view to be shown like that? please help.

I have a ListView with a custom adapter. I can click on the list elements. However, it only works when clicking outside of the text area of the row. When clicking on the text nothing happens.

I have set the Row layout as:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"


And the text style includes:

<item name="android:clickable">false</item>
<item name="android:focusable">false</item>
<item name="android:focusableInTouchMode">false</item>

Do you have a solution where I will be able to click anywhere in the row?

Is there a (persistent) configuration file where I can enter which static IP my ethernet interface should have?

Ie: How do I configure a (reboot-survivable) static IP address on Android using shell only?

I'm trying to understand android audio buffer management for streaming usecases e.g. YouTube streaming. As per my understanding from the following URL: http://quandarypeak.com/2013/08/androids-stagefright-media-player-architecture/ , application sends data to Stagefright Media Player through Native Media Player Subsystem.

Can someone please explain how the buffer transfer happens between Native Media Player and Stagefright Media Player? Does media data gets downloaded at Native Media Player or Stagefright Media Player?

In my navigation drawer I have to selections: 1)Laptop 2)Desktop How can I open another fragment when I click on Desktop? Sorry, I am new in Android Programming I have also visited the other questions about this in stackoverflow, but they still do not work Thanks

` public void onNavigationDrawerItemSelected(int position) { FragmentTransaction transaction = getFragmentManager().beginTransaction();

    switch (position){
        case 0:
            fragment = new FragmentBattery();
        case 1:
            fragment = new FragmentTweaks();
            .replace(R.id.container, fragment)

I am trying to make a calendar that shows a popup window when i long press the calendarview. But nothing happens when i do long click the calendarview. I tried using other event listeners like on click,onhover,etc. But none of them respond. I even thought of trying to use the calendarview as a dialog but none of the listeners i found in android documentation for dialog look for a long clock.

This is what i have tried to do.

public class MainActivity extends Activity{

PopupWindow p;
protected void onCreate(Bundle savedInstanceState) {
    CalendarView c=(CalendarView)findViewById(R.id.calendarView1);
    c.setOnLongClickListener(new OnLongClickListener() {

        public boolean onLongClick(View arg0) {
            return true;

        private void openpopupwindow() {
            // TODO Auto-generated method stub
            LayoutInflater inflator=(LayoutInflater)MainActivity.this.
            View lay=inflator.inflate(R.layout.add_appointment, (ViewGroup)findViewById(R.id.popupagenda));
            p=new PopupWindow(lay,300,300,true);
            p.showAtLocation(lay, Gravity.CENTER, 0, 0);
            Button badd=(Button)findViewById(R.id.bAdd);
            badd.setOnClickListener(new OnClickListener() {

                public void onClick(View arg0) {

i wanna develop an application, i wonder how can we developed this action bar like whatsApp



I would like to use the default ice cream sandwich radio button but not with ligth blue color. I would like to recolor it.

Can i somewhere found the original .xml files to recolor and use it in my project?

Iam new to Android NDK. I've installed NDK(android-NDK-r9d) in eclipse with the linux(62bit) os. First I tried to build and run sample hello-jni code, It worked successfully. After that I tried to run C code for that i followed http://mhandroid.wordpress.com/2011/01/23/using-eclipse-for-android-cc-development/ this link & I have created a c source file in jni folder, I included that file in Android.mk but while running in AVD it showing Unfortunately, HelloJni (project name) stopped.

Iam not getting why it is happening... whether still i have to do any settings??

Anyone Please help me..

THANKS in advance -Sri

Is this code true .I am using from AsyncTask for get result but cant not see any result and i am using WampServer. I think that my error logical is in my getter/setter :

public class NotesActivity extends Activity {
    protected void onCreate(Bundle savedInstanceState) {
                WebPageTask task = new WebPageTask();
                task.execute(new String[] { "" });

    private class WebPageTask extends AsyncTask<String, Void, String> {

        protected String doInBackground(String... urls) {
            String response = "";
            for (String url : urls) {
                DefaultHttpClient client = new DefaultHttpClient();
                HttpGet httpGet = new HttpGet(url);
                try {
                    HttpResponse execute = client.execute(httpGet);
                    InputStream content = execute.getEntity().getContent();

                    BufferedReader buffer = new BufferedReader(
                            new InputStreamReader(content));
                    String s = "";
                    while ((s = buffer.readLine()) != null) {
                        response += s;

                } catch (Exception e) {
            return response;

        protected void onPostExecute(String result) {
            ArrayList<StructTask> nettasks = new ArrayList<StructTask>();
            JSONObject object = null;
            JSONArray tasks = null;
            StructTask task = new StructTask();
            try {
             tasks = new JSONArray(result);
                for (int i = 0; i < tasks.length(); i++) {
                    object = tasks.getJSONObject(i);


            } catch (JSONException e) {
            for (StructTask taskesss : nettasks) {
                Log.i("LOG", "Taskes: " + taskesss.getid()+"|"+taskesss.gettitle()+"|"+taskesss.getdesc() + "-" + taskesss.getdone());


And this is Getter/Setter in StructTask.java. I think that i have logical error in my class getter/setter :

public class StructTask {
    private long id;
    private String title;
    private String desc;
    private boolean done;

    public long getid() {
        return this.id;

    void setid(long id) {
        this.id = id;

    public String gettitle() {
        return this.title;

    void settitle(String title) {
        this.title = title;

    public String getdesc() {
        return this.desc;

    void setdesc(String desc) {
        this.desc = desc;

    public boolean getdone() {
        return this.done;

    void setdone(boolean done) {
        this.done = done;

Bellow code dont return any results :

    for (StructTask taskesss : nettasks) {
        Log.i("LOG", "Taskes: " + taskesss.getid()+"|"+taskesss.gettitle()+"|"+taskesss.getdesc() + "-" + taskesss.getdone());

This is my sql page : THIS ONE AND THIS ONE

As i am new to android programming, I don't know how to call a certain class and/or certain activity first.

For example i have two classes viz. 1) Login.java 2) Create.java and two xml files associated with them are activity_main.xml and create_new.xml respectively. So how can i make Login.java run first with activity_main.xml as screen?

I need to be able to post screenshots of the interfaces of specific phones to create a user guide/documentation for an app. Going out and buying all of the 10 most popular phones would be expensive and inefficient. I've tried Genymotion, but it doesn't run a phone's exact interface, it shows the stock android interface instead. I've also tried running Nexus 5's stock ROM, "hammerhead" on android emulator via Eclipse and command line to no avail (crashed). I was hoping someone could help me with this. Thanks.

I am interested in developing some mobile apps and am curious as to where I can find a comparison between the different methods I have found as far as strengths and weaknesses.

I don't know JAVA, actionscript,or any other programming language per-se although have worked with them all to some degree.

I have a membership at Lynda.com and not scared of learning a language.

Android supports resources, which will be applied depending on navigation bar.
According to the documentation "values-navexposed" folder will be used if navigation bar is visible, "values-navhidden" folder otherwise.
How to use it correctly?

public void onCreate(Bundle savedInstanceState) {
    float floatValue = getResources().getDimension(R.dimen.test_float);

dimensions.xml (/res/values-navexposed and /res/values-navhidden):

<?xml version="1.0" encoding="utf-8"?>
    <item format="float" type="dimen" name="test_float">1</item>

The exception is:

android.content.res.Resources$NotFoundException: Resource ID #0x7f030000

I have a wcf rest service hosted on deployment server and i am trying to call it from an android device. I have tried almost all things on internet but it is still not working, it keeps giving me an error 'Endpoint not found'. Following is my code snippet

Android code:

            string url = "http://productionservertmp.com/Service1.svc/PostServiceRequest";
            HttpPost httpPost = new HttpPost(url);    

            JSONObject jobj = new JSONObject();
            jobj.put("reqobj", "Greetings from Android client");
            StringEntity se = new StringEntity( jobj.toString() );

            HttpClient client = new DefaultHttpClient();
            response = client.execute(httpPost);
            HttpEntity entity = response.getEntity();
            String data = null;
            JSONArray jsonResponse = null;
            try {
                  data = EntityUtils.toString(entity); //Here's where i find out about response (endpoint not found)
                  jsonResponse = new JSONArray(data);
             } catch (Exception e) {}

            //Signature of my function in interface:
            [WebInvoke(UriTemplate = "PostServiceRequest", ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, RequestFormat = WebMessageFormat.Json, Method = "POST")]
            string PostServiceRequest(string reqobj);

           //Method in Implementation class
           public string PostServiceRequest(string reqobj)
               return "Response: "+reqobj;

           //And in web.config on deployment server, I've following
           <service name="Service1">
           <endpoint address="" behaviorConfiguration="restBehavior" bindingConfiguration="" binding="webHttpBinding" contract="IService1">

I have another function in same service with Method = "GET" and it's been called successfully. Problem lies somewhere with POST method. What am i missing?

I've implemented the call recorder function with VOICE_CALL feature: http://developer.android.com/reference/android/media/MediaRecorder.AudioSource.html#VOICE_CALL

It can record the voice from both of incoming call and outgoing call very clearly .

But it only works perfectly on some handsets, such as Asus padfone, or hTC ONE (m7).

Some brands, such as hTC m8, Sony Z1, or Samsung S3 , they only record my voice while somebody's making a call to me. But they can't record the incoming call's voice.

My questions: (1) Is there any programmatically way to detect if this handset can record incoming call's voice correctly?

(2) Why the same brand phone have different result? for example, some hTC m8 can record perfectly, but some hTC m8 can only record one side.

Thanks in advance for any help:)