How to specify the path of AndroidManifest in android.mk? I change the path of AndroidManifest, how to specify the path of Androidmanifest? Should the path of AndroidManifest be the same path of android.mk? How many variables that is about AndroidManifest? I just know LOCAL_NO_MANIFEST.

Hi i'm trying to create my first android application which composed of two part one developed with jdeveloper 12c and the front end with android, i created a soap web service in order to consume it in the android part, i created an sqlite database also but i don't now how to synchronize the data in order to retrieve it.. this is how i created the web service in the jdeveloper

package model.Services;

import java.util.List;

import javax.annotation.Resource;

import javax.ejb.SessionContext;
import javax.ejb.Stateless;
import javax.ejb.TransactionAttribute;
import javax.ejb.TransactionAttributeType;

import javax.jws.Oneway;
import javax.jws.WebMethod;
import javax.jws.WebParam;
import javax.jws.WebService;

import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import javax.persistence.Query;

import javax.xml.ws.BindingType;
import javax.xml.ws.soap.SOAPBinding;

import model.Entite;

@Stateless(name = "SessionEJBEntity", mappedName = "Mobile_Survey-Model-SessionEJBEntity")
@WebService(name = "SessionEJBEntityBeanService", portName = "SessionEJBEntityBeanServicePort")
@BindingType(SOAPBinding.SOAP12HTTP_BINDING)
public class SessionEJBEntityBean implements SessionEJBEntity, SessionEJBEntityLocal {
    @Resource
    SessionContext sessionContext;
    @PersistenceContext(unitName = "Model")
    private EntityManager em;

    public SessionEJBEntityBean() {
    }

    @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
    @WebMethod (operationName = "querrybyrange")
    public Object queryByRange(@WebParam(name = "arg0") String jpqlStmt, @WebParam(name = "arg1") int firstResult,
                               @WebParam(name = "arg2") int maxResults) {
        Query query = em.createQuery(jpqlStmt);
        if (firstResult > 0) {
            query = query.setFirstResult(firstResult);
        }
        if (maxResults > 0) {
            query = query.setMaxResults(maxResults);
        }
        return query.getResultList();
    }

    @WebMethod (operationName = "presistentity")
    public Entite persistEntite(@WebParam(name = "arg0") Entite entite) {
        em.persist(entite);
        return entite;
    }

    @WebMethod (operationName = "mergenetity")
    public Entite mergeEntite(@WebParam(name = "arg0") Entite entite) {
        return em.merge(entite);
    }

    @WebMethod
    @Oneway
    public void removeEntite(@WebParam(name = "arg0") Entite entite) {
        entite = em.find(Entite.class, entite.getIdentité());
        em.remove(entite);
    }

    /** <code>select o from Entite o</code> */
    @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
    @WebMethod (operationName = "listEntity")
    public List<Entite> getEntiteFindAll() {
        return em.createNamedQuery("Entite.findAll", Entite.class).getResultList();
    }
}

i got this url : localhost:7101/Mobile_Survey-Model-webapp/SessionEJBEntityBeanService?WSDL

in the android i created a class named database

package com.example.myfirstapp;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteDatabase.CursorFactory;
import android.database.sqlite.SQLiteOpenHelper;

    public class Database extends SQLiteOpenHelper {
        private static final int DATABASE_VERSION = 1;
        private static final String TABLE_ENTITEE= "table_entitée";

        private static final String IDENTITÉ ="identité";
        private static final String TYPE_ENT="typeentité";
        private static final String ID_SECTEUR ="idsecteur";
        private static final String LONG_ENT ="longent";
        private static final String ATT_ENT ="attent";
        private static final String DESC_ENT="descent";
        private static final String  CREATE_ENTITEE= "CREATE TABLE "
                + TABLE_ENTITEE + " (" + IDENTITÉ
                + " INTEGER PRIMARY KEY AUTOINCREMENT," 
                + TYPE_ENT + " VARCHAR(100),"
                + ID_SECTEUR + "  VARCHAR(100)" 
                + LONG_ENT + " VARCHAR(100)"
                + ATT_ENT +  "VARCHAR(100)"
                + DESC_ENT+ "VARCHAR(300)"
                +")";


        // Database Name
        private static final String DATABASE_NAME = "mobileSurvey.db";
        public Database(Context context, String name, CursorFactory factory,
                int version) {
            super(context, name, factory, version);
        }

        public Database(Context context) {
            super(context, DATABASE_NAME, null, DATABASE_VERSION);
        }

        // Creating Tables
        public void onCreate(SQLiteDatabase db) {
            db.execSQL(CREATE_ENTITEE);
        }

        // Upgrading database

        @Override
        public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
            // Drop older table if existed

            db.execSQL("DROP TABLE IF EXISTS " +TABLE_ENTITEE );
            // Create tables again

                    onCreate(db);
                }



    }

and a class for the connction

package com.example.myfirstapp;

import java.io.InputStream;

import org.apache.http.impl.client.DefaultHttpClient;

import java.io.BufferedReader;

import java.io.InputStreamReader;
import java.util.ArrayList;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.NameValuePair;
import org.apache.http.client.HttpClient;
import org.apache.http.client.entity.UrlEncodedFormEntity;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpPost;

import android.util.Log;


    public class Connexion {
        private InputStream is = null;
        private HttpClient httpclient = new DefaultHttpClient();
        private HttpResponse response;
        private HttpEntity entity;
        private BufferedReader reader;
        private StringBuilder sb;
        private String line;
        private String result = "";

        public Connexion(String requete,String methode, ArrayList<NameValuePair> parametres){

                try{
                if (methode.equals("get")){
                    HttpGet httpget = new HttpGet(requete);
                    response = httpclient.execute(httpget);
                }else{
                    HttpPost httppost = new HttpPost(requete);
                    httppost.setEntity(new UrlEncodedFormEntity(parametres));
                    response = httpclient.execute(httppost);
                }

                entity = response.getEntity();
                is = entity.getContent();
                }catch(Exception e){
                        Log.e("log_tag", "Error in http connection "+e.toString());
                        result="[error]";
                }catch(OutOfMemoryError E){
                    Log.i("Erreur",E.toString());
                }

                try{
                reader = new BufferedReader(new InputStreamReader(is,"iso-8859-1"),8);
                sb = new StringBuilder();
                line = null;

                while ((line = reader.readLine()) != null) {
                        sb.append(line);
                }

                is.close();

                result = sb.toString();

                }catch(Exception e){
                        Log.e("log_tag", "Error converting result "+e.toString());
                        result="[error]";
                }catch(OutOfMemoryError E){
                    Log.i("Erreur",E.toString());
                }
        }


        public String getResult() {
            return result;
        }


    }

and a class to synchronize data

package com.example.myfirstapp;

import java.util.HashMap;

import android.content.Context;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.util.Log;

    public class SyncBDD {
        private static final int VERSION_BDD = 1;
        private static final String NOM_BDD = "mobileSurvey.db";
        private static final String TABLE_ENTITEE= "table_entitée";

        private SQLiteDatabase bdd;
            private Database database;

        public SyncBDD(Context context) {
            database = new Database(context, NOM_BDD, null, VERSION_BDD);
        }

        public void open() {
            bdd = database.getWritableDatabase();
        }

        public void close() {
            bdd.close();
        }

        public SQLiteDatabase getBDD() {
            return bdd;
        }

        void insert_entitée(HashMap<String, String>params){

            String selectQuery1 = "INSERT INTO " + TABLE_ENTITEE
                    + " VALUES (NULL," + "'" + params.get("TYPE_ENT")+
                    "'" + ", " + "'"
                    + params.get("ID_SECTEUR")+ "'" + ")";
            Log.e("insert_ingredient --->", selectQuery1);
            bdd.execSQL(selectQuery1);
            Log.e("gooooooooood --->", "good");


        }
    public Cursor get_entitée() {
        String s = "";
        String selectQuery = " select * from " + TABLE_ENTITEE;

        Cursor cursor = bdd.rawQuery(selectQuery, null);
        return cursor;
    }

    }

but i'm blocked how to pass data through the web service... can someone help me please?

hey i'm trying to create a tts for 3 different language they are english, spanish, and indonesia i got no problem with english and spanish they work fine, but i got and error with indonesian i tried different ways and different locale combination but still no luck

here is my code for indonesia : Locale locInd = new Locale("IDN"); int result = tts.setLanguage(locInd);

i've tried locale("in","ID"); locale("ind","IDN"); locale("in_ID); but also still no luck

every time i tried, the output is in english rather then indonesian

i used jellybean(4.2.2) emulator to run it and there is in_ID in locale when i run the emulator

I'm relatively new to programming, and I'm currently trying to grasp the concepts of SharedPreferences. In my application I have 3 TextViews, and I would like to save them and load them each time it is run. My title TextView and the one below, seem to work fine every time, but the two below those are the ones giving me the issue.

When I reload the app, the bottom two values will either be out of order, empty, or both based on the load order I've picked. Thanks.

The code (I left my notes on to possibly help future readers):

//this is before onCreate:

    SharedPreferences someData;

    //creating a file called filename
    public static String filename = "MySavedDay";




  //saving the data from the TextViews 

 @Override
protected void onStop() {
// TODO Auto-generated method stub

//getting the value of the TextViews
String titleData = tvTitle.getText().toString();
String topData = tvTop.getText().toString();
String midData = tvMid.getText().toString();
String botData = tvBot.getText().toString();

SharedPreferences.Editor editor = someData.edit();

//saving the value I captured earlier to the file I set up, using an editor
editor.putString("titleString", titleData);
editor.putString("topString", topData);
editor.putString("midString", midData);
editor.putString("botString", botData);







//finishing use of editor
editor.commit();


super.onStop();

}


//this is in onCreate to load the data
    someData = getSharedPreferences(filename, 0);

    String titleReturned = someData.getString("titleString", "title");
    tvmaintitle.setText(titleReturned);

    String topReturned = someData.getString("topString", "");
    tvTop.setText(topReturned);

    String midReturned = someData.getString("midString", "");
    tvMid.setText(midReturned);

    String botReturned = someData.getString("botString", "");
    tvBot.setText(botReturned);

I want to get session from webview. i did some google but not able to get what i am looking from right now i am using cookiemanager but i have no idea what i am doing. Actaully i want to get stored email from session. how we can do this.

webview.setWebViewClient(new WebViewClient(){

            @Override
            public boolean shouldOverrideUrlLoading(WebView view, String url) {
                // TODO Auto-generated method stub
                view.loadUrl(url);
                Log.v(TAG, "load url "+url);
                return super.shouldOverrideUrlLoading(view, url);


            }

            public void onPageFinished(WebView view, String urlString)
            {
                     Log.v(TAG, "page finish "+urlString);
                     CookieManager cm = CookieManager.getInstance();
                     String cookie = cm.getCookie("mysite.org");
                     Log.v(TAG, "COOKIE----\n\n"+cookie);
            }

            @Override
            public void onReceivedLoginRequest(WebView view, String realm,
                    String account, String args) {
                // TODO Auto-generated method stub
                super.onReceivedLoginRequest(view, realm, account, args);
                Log.v(TAG, "inside authentication \n");
                Log.v(TAG, "ACCOUNT----\n "+account+" REALM-------\n "+realm+" ARGS--------\n "+args);
            }



        });

        webview.loadUrl(w_url);

I have an activity that gets touch events (int x,int y, int type of event) and manage a mapview(osmdroid) or buttons with the given information. I have to cover the mapview so I placed it on a framelayout and place and upper image. If the upper image is visible, I am not able to pan the mapview underneath (but I am able to zoomIn and zoomOut).

this is my activity.xml

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/container"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.example.client.Client"
tools:ignore="MergeRootFrame" >

<Button
            android:id="@+id/Disconnect"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_weight="3"
            android:text="Disconnect/ Reconnect" 
            android:onClick="disconnect"/>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/frameLayout"
android:layout_below="@+id/disconnect">

<LinearLayout
    android:id="@+id/memeContent"
    android:layout_width="535px"
    android:layout_height="350px"
    android:layout_alignParentBottom="true"
    android:layout_alignParentLeft="true"
    android:orientation="vertical" 
    >

    <org.osmdroid.views.MapView
        android:id="@+id/mapView"
        android:layout_width="match_parent"
        android:layout_height="300px" 
        >
    </org.osmdroid.views.MapView>

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="50px"
         >

        <Button
            android:id="@+id/ZoomIn"
            android:layout_width="wrap_content"
            android:layout_height="fill_parent"
            android:layout_weight="5"
            android:onClick="ZoomIn"
            android:text="Zoom In"
            android:textSize="10dp" />

        <Button
            android:id="@+id/ZoomOut"
            android:layout_width="wrap_content"
            android:layout_height="fill_parent"
            android:layout_weight="5"
            android:text="Zoom out"
            android:onClick="ZoomOut" 
            android:textSize="10dp" />

    </LinearLayout>

</LinearLayout>
  <ImageView
    android:id="@+id/imageViewFront"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:src="@drawable/image"
    android:scaleType="centerCrop" 
    android:focusable="false"
    android:focusableInTouchMode="false"/>



</FrameLayout>

</RelativeLayout>

and this is my MainActivity.java

public class MainActivity extends Activity {
LinearLayout memecontentView;   
FrameLayout frameLayout;
ImageView imageViewFront;
View v;
MapView mapView;

    @Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_client_late);
    imageViewFront= (ImageView) findViewById(R.id.imageViewFront);
    //imageViewFront.setVisibility(View.GONE);
    mapView  = (MapView) findViewById(R.id.mapView);
    mapView.setTileSource(TileSourceFactory.MAPQUESTOSM);
    mapView.setMultiTouchControls(true);
    mapView.setUseDataConnection(true);
    memecontentView=(LinearLayout) findViewById(R.id.memeContent);
    mapView.setBuiltInZoomControls(false);
}
//look for items in given coordinates
public void lookForButton(String msg){
    String[] strArray = msg.split(" ");
    final MotionEvent m;
    final int x=Integer.valueOf(strArray[1]);
    final int y=Integer.valueOf(strArray[2]);
    int type=Integer.valueOf(strArray[3]);
    switch (type){
        case 2:
            m = MotionEvent.obtain(226707,226707,0/*ACTION_DOWN*/,x,y,0);
            runOnUiThread(new Runnable() {
                public void run() {
                    memecontentView.dispatchTouchEvent(m);
                }
            });
            break;
    case 3:
        m = MotionEvent.obtain(226707,226707,1/*ACTION_DOWN*/,x,y,0);
        runOnUiThread(new Runnable() {
            public void run() {
                memecontentView.dispatchTouchEvent(m);
            }
        }); 
        break;
    case 5:
        m = MotionEvent.obtain(226707,226707,2/*ACTION_MOVE*/,x,y,0);
        runOnUiThread(new Runnable() {
            public void run() {
                memecontentView.dispatchTouchEvent(m);
            }
        }); 
        break;  
    }

}
public void ZoomIn(View v){
    mapView.getController().zoomIn();
}
public void ZoomOut(View v){
    mapView.getController().zoomOut();
}
}

If the upper image is not visible (imageViewFront.setVisibility(View.INVISIBLE);) the code above works great, but if I comment that line(I need to do it), I am not able to pan the mapview. I do not know if the upper image is stealing its touchevents. How can I prevent that? or how can I make MapView's touch events work even if mapView is under?

I have made an android AVD for google api version 19. the problem is that it doesn't load and prompts this error message: "emulator-x86 has stopped working, a problem caused the program to stop working correctly...."

the AVD configurations are: AVD confguation

could you help to fint the error?

thanks

Well I don't have much android experience let alone android animation and I need to make an animation that makes balloons fly up from the bottom of the screen on the touch of a button. I made the button but idk what I'm doing from this point on. So what I need to know is where I get the images where to put the images and how to make the images move(balloons being the images).

I have a screen with Google map showing up. I have added button on the map as LayoutInflater.

Here is the following code for it,

LayoutInflater mInflater = (LayoutInflater) this
            .getSystemService(Activity.LAYOUT_INFLATER_SERVICE);
View convertView = mInflater.inflate(R.layout.inflater_search_on_map, null);
LayoutParams layoutParams = new RelativeLayout.LayoutParams(
            LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);

    addContentView(convertView, layoutParams);

So with this code i am able to show certain inflater_search_on_map xml design on the map.

But the issue is i even have NavigationDrawer on the same activity so when i click on the navigationdrawer and as it opens up drawer the convertview which i customized will be shown on top of navigationdrawer so i was thinking can i hide that view or any other solutions do we have for this scenario.

I have the following code on my onResume() method of my Activity:

mFragmentManager.popBackStack(FragmentNames.FRAG_MY_CLASS, FragmentManager.POP_BACK_STACK_INCLUSIVE);
FragmentTransaction fragTransaction = mFragmentManager.beginTransaction();
fragTransaction.add(R.screenHome.content, MyClass.newInstance(), FragmentNames.FRAG_MY_CLASS);
fragTransaction.commit();

It works as intended. The behavior I expected was to pop from the backstack the specified fragment if before adding it. I do this because I wanted to recreate the fragment view everytime, when I come to it from the previous activity or when I press back from the next activity. But I don't understand why it works, popping up the specified fragment if I didn't do this before commiting:

fragTransaction.addToBackStack(FragmentNames.FRAG_MY_CLASS);

Can anyone know why it works? Oddly, also is that I call popBackStack with the tag name I used to add the specified Fragment.

The program runs if i comment everything to do with the other activity out, but when I try to run my program with it in it crashes as soon as it hits this line:

    if(savedInstanceState == null)
    {
        settings.setImperial(true);
        settings.setUK(true);
    }

I have created an Object of the class I wish to use:

private FuelEconomySettingsActivity settings = new FuelEconomySettingsActivity();

Here is FuelEconomyCalculatorActivity.java

package com.example.fuelcalculator;

import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.ActionBarActivity;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
import android.widget.RadioButton;
import android.widget.TextView;
import android.widget.Toast;

public class FuelEconomyCalculatorActivity extends ActionBarActivity implements
        OnClickListener {

    private EditText fuelEditText;
    private EditText distanceEditText;
    private TextView mpgTextView;
    private TextView litresTextView;
    private Button calculateButton;
    private Button clearButton;
    private RadioButton gallonsRadio;
    private RadioButton litresRadio;
    private RadioButton milesRadio;
    private RadioButton kmRadio;
    private String mpg = " ";
    private String kp100 = " ";

    private FuelEconomySettingsActivity settings = new FuelEconomySettingsActivity();

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_fuel_economy_calculator);
        fuelEditText = (EditText) findViewById(R.id.fuelEditText);
        distanceEditText = (EditText) findViewById(R.id.distanceEditText);
        mpgTextView = (TextView) findViewById(R.id.mpgTextView);
        litresTextView = (TextView) findViewById(R.id.litresTextView);
        calculateButton = (Button) findViewById(R.id.calculateButton);
        clearButton = (Button) findViewById(R.id.clearButton);
        gallonsRadio = (RadioButton) findViewById(R.id.gallonsRadio);
        litresRadio = (RadioButton) findViewById(R.id.litresRadio);
        milesRadio = (RadioButton) findViewById(R.id.milesRadio);
        kmRadio = (RadioButton) findViewById(R.id.kmRadio);
        calculateButton.setOnClickListener(this);
        clearButton.setOnClickListener(this);

        litresRadio.setChecked(true);
        kmRadio.setChecked(true);

        if(savedInstanceState == null)
        {
            settings.setImperial(true);
            settings.setUK(true);
        }

        if (settings.getImperial()) {
            litresRadio.setChecked(true);
            kmRadio.setChecked(true);
        } else if (settings.getMetric()) {
            gallonsRadio.setChecked(true);
            milesRadio.setChecked(true);
        }

        if (savedInstanceState != null) {
            mpg = savedInstanceState.getString("mpg");
            kp100 = savedInstanceState.getString("kp100");
        }
        initializeViews();
    }

    protected void onSaveInstanceState(Bundle savedInstanceState) {
        super.onSaveInstanceState(savedInstanceState);
        savedInstanceState.putString("mpg", (String) mpgTextView.getText());
        savedInstanceState.putString("kp100", (String) litresTextView.getText());
    }

    private void initializeViews() {
        mpgTextView.setText(mpg);
        litresTextView.setText(kp100);
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.menu.fuel_economy_calculator, menu);
        return true;
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        // Handle action bar item clicks here. The action bar will
        // automatically handle clicks on the Home/Up button, so long
        // as you specify a parent activity in AndroidManifest.xml.
        switch (item.getItemId()) {
        case R.id.action_settings: {
            Intent intent = new Intent(FuelEconomyCalculatorActivity.this,
                    FuelEconomySettingsActivity.class);
            startActivity(intent);
            return true;
        }

        case R.id.action_about: {
            Intent intent = new Intent(FuelEconomyCalculatorActivity.this,
                    FuelEconomyAboutPageActivity.class);
            startActivity(intent);
            return true;
        }

        default:
            return super.onOptionsItemSelected(item);
        }
    }

    @Override
    public void onClick(View v) {
        if (v.getId() == R.id.calculateButton) {
            float mpg = 0;
            float kmLitres = 0;
            // it doesn't matter which you use here, as long
            // as you use a fuel and a distance method
            if (settings.getUK() && !settings.getUS()) {
                if (getKM() > 0 && getLitres() > 0) {
                    mpg = getMiles() / getGallons();
                    kmLitres = getLitres() / (getKM() / 100);
                    mpgTextView.setText(String.format("%.2f", mpg));
                    litresTextView.setText(String.format("%.2f", kmLitres));
                }
            } else if (settings.getUS() && !settings.getUK()) {
                if (getKM() > 0 && getLitres() > 0) {
                    mpg = getMiles() / getGallonsUS();
                    kmLitres = getLitresUS() / (getKM() / 100);
                    mpgTextView.setText(String.format("%.2f", mpg));
                    litresTextView.setText(String.format("%.2f", kmLitres));
                }
            }
        } else if (v.getId() == R.id.clearButton) {
            resetValues();
        }

    }

    public float CheckValues(EditText input) {
        float value = 0;
        try {
            value = Float.parseFloat(input.getText().toString());
            if (value < 1) {
                Toast toast = Toast.makeText(this,
                        "Please enter a number that is larger than 0",
                        Toast.LENGTH_SHORT);
                toast.show();
            }
        } catch (Exception ex) {
            Toast toast = Toast.makeText(this, "Please enter a number",
                    Toast.LENGTH_SHORT);
            toast.show();
        }
        return value;
    }

    public void resetValues() {
        mpg = " ";
        kp100 = " ";
        fuelEditText.setText("");
        distanceEditText.setText("");
        mpgTextView.setText("");
        litresTextView.setText("");
    }

    public float getKM() {
        float distance = CheckValues(distanceEditText);
        if (milesRadio.isChecked()) {
            distance = (float) (distance * 1.60934);
        }
        return distance;
    }

    public float getMiles() {
        float distance = CheckValues(distanceEditText);
        if (kmRadio.isChecked()) {
            distance = (float) (distance * 0.62137);
        }
        return distance;
    }

    public float getLitres() {
        float fuel = CheckValues(fuelEditText);
        if (gallonsRadio.isChecked()) {
            fuel = (float) (fuel * 4.54609);
        }
        return fuel;
    }

    public float getLitresUS() {
        float fuel = CheckValues(fuelEditText);
        if (gallonsRadio.isChecked()) {
            fuel = (float) (fuel * 3.785411784);
        }
        return fuel;
    }

    public float getGallons() {
        float fuel = CheckValues(fuelEditText);
        if (litresRadio.isChecked()) {
            fuel = (float) (fuel * 0.219969);
        }
        return fuel;
    }

    public float getGallonsUS() {
        float fuel = CheckValues(fuelEditText);
        if (litresRadio.isChecked()) {
            fuel = (float) (fuel * 0.264172);
        }
        return fuel;
    }
}

And here is my FuelEconomySettingsActivity.java

package com.example.fuelcalculator;

import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.RadioButton;

public class FuelEconomySettingsActivity extends FuelEconomyCalculatorActivity {

    private RadioButton metricRadio;
    private RadioButton imperialRadio;
    private RadioButton usRadio;
    private RadioButton ukRadio;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_fuel_economy_about);

        metricRadio = (RadioButton) findViewById(R.id.metricRadioText);
        imperialRadio = (RadioButton) findViewById(R.id.imperialRadioText);
        usRadio = (RadioButton) findViewById(R.id.usRadioText);
        ukRadio = (RadioButton) findViewById(R.id.ukRadioText);

        imperialRadio.setChecked(true);
        ukRadio.setChecked(true);

    }

    public void setMetric(boolean b) {
        metricRadio.setChecked(b);
    }

    public void setImperial(boolean b) {
        imperialRadio.setChecked(b);
    }

    public void setUS(boolean b) {
        usRadio.setChecked(b);
    }

    public void setUK(boolean b) {
        ukRadio.setChecked(b);
    }   

    public boolean getMetric() {
        if (metricRadio.isChecked())
            return true;
        else
            return false;
    }

    public boolean getImperial() {
        if (imperialRadio.isChecked())
            return true;
        else
            return false;
    }

    public boolean getUS() {
        if (usRadio.isChecked())
            return true;
        else
            return false;
    }

    public boolean getUK() {
        if (ukRadio.isChecked())
            return true;
        else
            return false;
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.menu.fuel_economy_calculator, menu);
        return true;
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        // Handle action bar item clicks here. The action bar will
        // automatically handle clicks on the Home/Up button, so long
        // as you specify a parent activity in AndroidManifest.xml.
        switch (item.getItemId()) {
        case R.id.action_about: {
            Intent intent = new Intent(FuelEconomySettingsActivity.this,
                    FuelEconomyAboutPageActivity.class);
            startActivity(intent);
            return true;
        }

        case R.id.action_main: {
            Intent intent = new Intent(FuelEconomySettingsActivity.this,
                    FuelEconomyCalculatorActivity.class);
            startActivity(intent);
            return true;
        }

        default:
            return super.onOptionsItemSelected(item);
        }
    }
}

I am new to Android so I am not very good at debugging so could someone please assist me with my predicament?

Thanks in advance! :)

I work with eclipse and I would like to use from external project library some class. Every time I open project properties add this external project I get following problem. There is no problems with another project libraries. This additional project has ticked "Is Library". enter image description here

How can i manipulate browsers elements atributes like inputs, buttons, labels, tables with tasker?

Exemple html page of "mypage/login.php":

<input type="hidden" name="magic" value="123456">
<input name="username" id="ft_un" style="width:245px">
<input name="password" id="ft_pd" type="password" style="width:245px">
<button id='bt1' type="submit" value="Continue">

1) enter the page mypage/login.php
2) get value from input name=magic into some tasker variable %varmagic
3) set inputs name="username" = user
4) set inputs name="password" = 123
5) click button id='bt1'

if i can do this if rest will be fine to. but i have a problemn to get value "magic" element before my request post.

I am very new to android development with eclipse, and I encounter dozen of errors and problems. Here is the next one:

I am following the tutorial given here. I was about to enter the session Setting Up the Action Bar , and to follow the instructions for 'Support Android 2.1 and Above', as I believe my phone has an android version below 3. Therefore, I followed the instructions given here, in the sub section 'Adding libraries with resources'. I successfully followed all steps, but after the last step for 'Add the library to your application project' (step 5) a red exclamation mark popped up at my project, and the console was filled with many error messages (listed below).

What have I done wrong this time? Maybe I tried to add something twice? How to revert my actions then? Or is the tutorial (again) incorrect?

Output of console (partial):

[2014-07-17 20:45:00 - TestApp] /home/alexander/Projects/Eclipse/appcompat_v7/res/values/attrs.xml:530: error: Attribute "searchViewGoIcon" has already been defined
[2014-07-17 20:45:00 - TestApp] /home/alexander/Projects/Eclipse/appcompat_v7/res/values/attrs.xml:532: error: Attribute "searchViewSearchIcon" has already been defined
[2014-07-17 20:45:00 - TestApp] /home/alexander/Projects/Eclipse/appcompat_v7/res/values/attrs.xml:534: error: Attribute "searchViewVoiceIcon" has already been defined
[2014-07-17 20:45:00 - TestApp] /home/alexander/Projects/Eclipse/appcompat_v7/res/values/attrs.xml:536: error: Attribute "searchViewEditQuery" has already been defined
[2014-07-17 20:45:00 - TestApp] /home/alexander/Projects/Eclipse/appcompat_v7/res/values/attrs.xml:538: error: Attribute "searchViewEditQueryBackground" has already been defined
[2014-07-17 20:45:00 - TestApp] /home/alexander/Projects/Eclipse/appcompat_v7/res/values/attrs.xml:540: error: Attribute "searchViewTextField" has already been defined
[2014-07-17 20:45:00 - TestApp] /home/alexander/Projects/Eclipse/appcompat_v7/res/values/attrs.xml:542: error: Attribute "searchViewTextFieldRight" has already been defined
[2014-07-17 20:45:00 - TestApp] /home/alexander/Projects/Eclipse/appcompat_v7/res/values/attrs.xml:544: error: Attribute "searchResultListItemHeight" has already been defined
[2014-07-17 20:45:00 - TestApp] /home/alexander/Projects/Eclipse/appcompat_v7/res/values/attrs.xml:546: error: Attribute "textAppearanceSearchResultTitle" has already been defined
[2014-07-17 20:45:00 - TestApp] /home/alexander/Projects/Eclipse/appcompat_v7/res/values/attrs.xml:548: error: Attribute "textAppearanceSearchResultSubtitle" has already been defined
[2014-07-17 20:45:00 - TestApp] /home/alexander/Projects/Eclipse/appcompat_v7/res/values/attrs.xml:550: error: Attribute "textColorSearchUrl" has already been defined
[2014-07-17 20:45:00 - TestApp] /home/alexander/Projects/Eclipse/appcompat_v7/res/values/attrs.xml:552: error: Attribute "searchViewAutoCompleteTextView" has already been defined
[2014-07-17 20:45:00 - TestApp] /home/alexander/Projects/Eclipse/appcompat_v7/res/values/attrs.xml:557: error: Attribute "initialActivityCount" has already been defined
[2014-07-17 20:45:00 - TestApp] /home/alexander/Projects/Eclipse/appcompat_v7/res/values/attrs.xml:564: error: Attribute "expandActivityOverflowButtonDrawable" has already been defined
[2014-07-17 20:45:00 - TestApp] /home/alexander/Projects/Eclipse/appcompat_v7/res/values/attrs.xml:568: error: Attribute "activityChooserViewStyle" has already been defined
[2014-07-17 20:45:00 - TestApp] /home/alexander/Projects/Eclipse/appcompat_v7/res/values/attrs.xml:572: error: Attribute "textAllCaps" has already been defined

Addendum: Android Properties for my TestApp:

image

Maybe I am using this stupid appcompat_v7 twice? Should I remove one of them? If so, which? The android-support-v7 has been added by the steps as explained above.

I am working on a (previously created project) and don't want to throw away most of their code.Thus, I want to do something like "replicating actions on a view (like setText, animating, ...) onto a different object, but the same view":

Something like (how I would love if it would work like this):

someView.addViewChangeListener(new ViewChangeListener()
    {
        public void onViewChangedAction(ViewChangedAction action)
            {
                myotherviewobject.executeAction(action)
            }
    });

This would be the simplest way, but I haven't found an API to do so. There are actually multiple custom views etc. So I need a very "general" solution. Does a solution like this exist?

If not... any ideas on how to do this in a usable way without interfering too much into other's people's code?

Thanks in advance.

I want to started some development in StrretView and for that i used SupportStreetViewPanoramaFragment. but when i start my application it's crash with below logcat.

07-17 16:33:53.805: E/AndroidRuntime(19449): FATAL EXCEPTION: main
07-17 16:33:53.805: E/AndroidRuntime(19449): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.stacky/com.example.stacky.SplitStreetViewPanorama}: java.lang.NullPointerException
07-17 16:33:53.805: E/AndroidRuntime(19449):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2295)
07-17 16:33:53.805: E/AndroidRuntime(19449):    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2349)
07-17 16:33:53.805: E/AndroidRuntime(19449):    at android.app.ActivityThread.access$700(ActivityThread.java:159)
07-17 16:33:53.805: E/AndroidRuntime(19449):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1316)
07-17 16:33:53.805: E/AndroidRuntime(19449):    at android.os.Handler.dispatchMessage(Handler.java:99)
07-17 16:33:53.805: E/AndroidRuntime(19449):    at android.os.Looper.loop(Looper.java:176)
07-17 16:33:53.805: E/AndroidRuntime(19449):    at android.app.ActivityThread.main(ActivityThread.java:5419)
07-17 16:33:53.805: E/AndroidRuntime(19449):    at java.lang.reflect.Method.invokeNative(Native Method)
07-17 16:33:53.805: E/AndroidRuntime(19449):    at java.lang.reflect.Method.invoke(Method.java:525)
07-17 16:33:53.805: E/AndroidRuntime(19449):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1046)
07-17 16:33:53.805: E/AndroidRuntime(19449):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:862)
07-17 16:33:53.805: E/AndroidRuntime(19449):    at dalvik.system.NativeStart.main(Native Method)
07-17 16:33:53.805: E/AndroidRuntime(19449): Caused by: java.lang.NullPointerException
07-17 16:33:53.805: E/AndroidRuntime(19449):    at com.example.stacky.SplitStreetViewPanorama.setUpStreetViewPanoramaIfNeeded(SplitStreetViewPanorama.java:42)
07-17 16:33:53.805: E/AndroidRuntime(19449):    at com.example.stacky.SplitStreetViewPanorama.onCreate(SplitStreetViewPanorama.java:36)
07-17 16:33:53.805: E/AndroidRuntime(19449):    at android.app.Activity.performCreate(Activity.java:5372)
07-17 16:33:53.805: E/AndroidRuntime(19449):    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1104)
07-17 16:33:53.805: E/AndroidRuntime(19449):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2257)

My Activity code is below:

public class SplitStreetViewPanorama extends FragmentActivity
implements OnMarkerDragListener, OnStreetViewPanoramaChangeListener {

private StreetViewPanorama svp;
private GoogleMap mMap;
private Marker marker;

// George St, Sydney
private static final LatLng SYDNEY = new LatLng(-33.87365, 151.20689);

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);

    setUpStreetViewPanoramaIfNeeded(savedInstanceState);
}

private void setUpStreetViewPanoramaIfNeeded(Bundle savedInstanceState) {
    if (svp == null) {
        svp = ((SupportStreetViewPanoramaFragment)getSupportFragmentManager().findFragmentById(R.id.streetviewpanorama)).getStreetViewPanorama();
        setUpMap();
        if (svp != null) {
            if (savedInstanceState == null) {
                svp.setPosition(SYDNEY);
            }
            svp.setOnStreetViewPanoramaChangeListener(this);
        }
    }
}

@Override
public void onStreetViewPanoramaChange(StreetViewPanoramaLocation location) {
    if (location != null) {
      marker.setPosition(location.position);
    }
}

private void setUpMap() {
    mMap.setOnMarkerDragListener(this);
    // Creates a draggable marker. Long press to drag.
    marker = mMap.addMarker(new MarkerOptions()
            .position(SYDNEY)
            .draggable(true));
}

@Override
public void onMarkerDragStart(Marker marker) {
}

@Override
public void onMarkerDragEnd(Marker marker) {
    svp.setPosition(marker.getPosition(), 150);
}

@Override
public void onMarkerDrag(Marker marker) {
}

Application got crashed at this line

  svp = ((SupportStreetViewPanoramaFragment)getSupportFragmentManager().findFragmentById(R.id.streetviewpanorama)).getStreetViewPanorama();

My Layout is

<fragment xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/streetviewpanorama"
android:layout_width="match_parent"
android:layout_height="match_parent"
class="com.google.android.gms.maps.StreetViewPanoramaFragment" />

Any help or idea would appreciated.

I try to get an intent action in my receiver just after the actual connection with a wireless network has been established.

I'm now working with "NETWORK_STATE_CHANGED_ACTION" but this is fired when the connection has been successful but not yet activated. It takes a few seconds to fully connect and that's when isConnected() returns true (which I use to mark some changes).

ConnectivityManager cm = (ConnectivityManager) getSystemService(CONNECTIVITY_SERVICE);
NetworkInfo wifiNI = cm.getNetworkInfo(ConnectivityManager.TYPE_WIFI);

wifiNI.isConnected();

I also tried using "SUPPLICANT_CONNECTION_CHANGE_ACTION" but I couldn't get any action in my receiver.

Any ideas?

I am implementing a gallery of images that are stored in a folder in the SD card. The images are copied from the server. I am trying to display thumbnails using the Interface ExifInterface. It has a very nice method getThumbnail. This method returns a thumbnail if it exists or null if not. But the condition is that the image NEEDS to contain the thumbnail WITHIN.

My Question is: How can I create a thumbnail INSIDE the image when I save the image to SD card so that ExifInterface.getThumbnail detects that thumb and does not return null

Can anybody explain when exactly the method telephonemanager.getSimState() returns a SIM_STATE_READY in Dual sim phone? In other words, when sim is present/active and connected to network, or when sim is present/active and it may or may not be connected to network?

I am new in android development and i wanted to ask some questions. I am photographer and i want to make application for android where are photos taken by me and other people can set these pictures as wallpaper. I have aleready tried things in eclipse but these are very pale. I don't want to add every single picture into the code one by one. If anyone have such project I'm willing to pay for it. Any help would be very apreciated.

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.