Re: Bluetooth killer availabled in Android ? - WiFi Direct

by KJ » Tue, 15 Mar 2011 05:25:31 GMT


Sponsored Links
 I haven't yet seen anything in the Android SDK relating to Wi-fi
Direct...does anyone yet have any info on using this technology on the
Android devices supporting wifi direct?  Or is this a technology
reserved for the devices' "built in" apps and not something readily
available to developers?




-- 



Re: Re: Bluetooth killer availabled in Android ? - WiFi Direct

by Irfan Sheriff » Tue, 15 Mar 2011 05:49:49 GMT


 Its in active development at this time. Nothing in the SDK for developers
right now.

Irfan






-- 


Sponsored Links


Re: Bluetooth killer availabled in Android ? - WiFi Direct

by metal mikey » Tue, 15 Mar 2011 08:07:14 GMT


Other Threads

1. json parser giving no output

hello guys.. this is JSONhelper class where i m parsing theurl and
finally in some another class i have written the follwing lines to get
the output

        JSONhelper jsoNhelper=new JSONhelper(getApplicationContext());
                jsoNhelper.getJson();
                ArrayList<PlaceInformation> a=jsoNhelper.resultArrayList;
                Log.v("First", " arrayList length="+ a.size());


but above lines show the length as zero... pls check the parser and
let me know where i m wrong. or pls provide the code to me..needed


************************

package com.example;

import java.io.IOException;
import java.util.ArrayList;

import org.apache.http.HttpResponse;
import org.apache.http.ParseException;
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 org.apache.http.util.EntityUtils;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

import android.content.Context;
import android.util.Log;

public class JSONhelper {
        //private final String TAG = "JSONhelper";
//      private final String API_KEY =
"ABQIAAAAtyg3DZbOZx4k8yKBrp80RBS4tlSElwKHfak6B1dJPxb7rRmHMRT1HQ77dOcnasJbwsK6tpUyy_thEg";
        // private final String
        // URL="http://174.120.32.69/~mobadmin/clients/milehigh/api/
fetch_data/all/yes";
        // private final String baseURL =
        // "http://174.120.32.69/~mobadmin/clients/milehigh/api/fetch_data/
all/no/since/";
        private final String baseURL = "http://ajax.googleapis.com/ajax/
services/search/local?v=1.0&sll=48.8565,2.3509&q=restaurant";
//      private final String HEADER = "x-api-key";

        JSONArray resultsJsonArray;
        JSONObject placesJsonObject;
        ArrayList<PlaceInformation> resultArrayList = new
ArrayList<PlaceInformation>();

        // UpdateSharedPreferences updateSharedPreferences;

        // public ArrayList<MFShow> showArrayListFromJSON = new
ArrayList<MFShow>();
        // public ArrayList<MFArtist> artistArrayListFromJSON = new
        // ArrayList<MFArtist>();
        // public ArrayList<MFStage> stageArrayListFromJSON = new
        // ArrayList<MFStage>();

        public JSONhelper(Context context) {

                // updateSharedPreferences = new 
UpdateSharedPreferences(context);
        }

        public void getJson() {
                HttpGet httpGet = getHttpUriRequest();
                HttpClient httpClient = getHttpClient();
                HttpResponse httpResponse = getHttpResponse(httpGet, 
httpClient);
                JSONObject jsonObject = getJSONObject(httpResponse);

                // initialiseArrayLists(jsonObject);
                getResultsArrayList(jsonObject);
                // Log.v(TAG, "ArrayList initialized=" + flag);
        }

        // String getURL(String since) {
        //
        // String Url = null;
        // Url = baseURL + since;
        //
        // return Url;
        //
        // }

        public void getResultsArrayList(JSONObject jsonObject) {
                try {
                        resultsJsonArray = jsonObject.getJSONArray("resuslt");
                        for (int i = 0; i < resultsJsonArray.length(); i++) {
                                placesJsonObject = 
resultsJsonArray.getJSONObject(i);
                                getPlaceInformation(placesJsonObject);
                        }
                } catch (Exception e) {
                        // TODO: handle exception
                }
        }

        private void getPlaceInformation(JSONObject placesJsonObject2)
                        throws JSONException {
                PlaceInformation placeinfo = new PlaceInformation();
                placeinfo.lat = placesJsonObject2.getString("lat");
                placeinfo.lng = placesJsonObject2.getString("lng");
                placeinfo.title = placesJsonObject2.getString("title");
                placeinfo.city = placesJsonObject2.getString("city");
                placeinfo.country = placesJsonObject2.getString("country");
                placeinfo.streetAddress =
placesJsonObject2.getString("streetAddress");

                placeinfo.addressLines1 = placesJsonObject2
                                .getJSONArray("addressLines").getString(0);
                placeinfo.addressLines2 = placesJsonObject2
                                .getJSONArray("addressLines").getString(1);

                placeinfo.phoneNumbers =
placesJsonObject2.getJSONArray("phoneNumbers")
                                .getJSONObject(0).getString("phoneNumbers");

                resultArrayList.add(placeinfo);

        }

        // public void getResults(JSONObject jsonObject)
        // public ArrayList<MFShow> getShowArrayListFromJSON() {
        // return showArrayListFromJSON;
        // }
        //
        // public ArrayList<MFArtist> getArtistArrayListFromJSON() {
        // return artistArrayListFromJSON;
        // }
        //
        // public ArrayList<MFStage> getStageArrayListFromJSON() {
        // return stageArrayListFromJSON;
        // }

        private HttpGet getHttpUriRequest() {
                HttpGet get = null;
                Log.v("111", "tt" + get);

                String URL = baseURL;// getURL(("since"));
                try {
                        get = new HttpGet(URL);
                        Log.v("111", "tt" + get);
                        Log.v("111", "tt" + URL);
                } catch (IllegalArgumentException e) {
                        // Log.v(TAG, "IllegalArgumentException");
                        e.printStackTrace();
                }
//              get.addHeader(HEADER, API_KEY);
                return get;
        }

        private HttpClient getHttpClient() {
                HttpClient httpClient = new DefaultHttpClient();
                Log.v("222", "ccc" + httpClient);
                return httpClient;
        }

        private HttpResponse getHttpResponse(HttpGet get, HttpClient
httpClient) {
                HttpResponse httpResponse = null;
                try {
                        Log.v("getHttpResponse====", "httpClient" + httpClient);
                        Log.v("getHttpResponse====", "get" + get);
                        httpResponse = httpClient.execute(get);
                        Log.v("333", "rrr" + httpResponse);

                } catch (ClientProtocolException e) {

                        e.printStackTrace();
                } catch (IOException e) {
                        // Log.v(TAG, "IOException");
                        e.printStackTrace();
                }
                return httpResponse;

        }

        JSONObject getJSONObject(HttpResponse httpResponse) {

                String jsonString = null;
                JSONObject responseDataJsonObject = null;
                if (httpResponse.getStatusLine().toString().equals("HTTP/1.1 200
OK"))

                {
                        try {
                                jsonString = 
EntityUtils.toString(httpResponse.getEntity());
                                Log.v("sdfvsd", "*********" + 
jsonString.toString());
                                responseDataJsonObject = new 
JSONObject(jsonString);

                        } catch (ParseException e) {
                                // Log.v(TAG, "ParseException");
                                e.printStackTrace();
                        } catch (IOException e) {
                                // Log.v(TAG, "IOException");
                                e.printStackTrace();
                        } catch (JSONException e) {
                                // Log.v(TAG, "JSONException");
                                e.printStackTrace();
                        }
                }
                return responseDataJsonObject;
        }

}

-- 

2. How to change color of ListView child items on focus

Hi all.

i have a list View in my app (this is the xml layout):

<?xml version="1.0" encoding="utf-8"?>
<ListView xmlns:android="http://schemas.android.com/apk/res/android"
        android:id="@+id/arrayList"
        android:layout_width="fill_parent"
android:layout_height="fill_parent"
        android:textFilterEnabled="true"
        android:scrollbars="vertical"
        android:drawSelectorOnTop="true">
</ListView>


Each item of my list View is composed of two TextView:

<?xml version="1.0" encoding="utf-8"?>
<TableLayout android:layout_width="fill_parent"
        xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/row_container"
        android:padding="5px" android:layout_height="wrap_content"
        android:background="@color/white" android:shrinkColumns="0">
                <TableRow>
                <TextView android:layout_height="wrap_content"
                        android:layout_width="wrap_content" 
android:layout_below="@+id/
description"
                        android:id="@+id/description"
                        android:textColor="@color/black"
                        android:scrollHorizontally="true"
                        android:singleLine="true"></TextView>
        </TableRow>
        <TableRow>
                <TextView android:layout_width="wrap_content"
                        android:layout_height="wrap_content" 
android:id="@+id/result"
                        android:textColor="@color/grey"
                        android:maxLines="1"
                        android:scrollHorizontally="true"></TextView>
        </TableRow>

</TableLayout>

I would like to change background color (and text color) of each item
of my ListView on focus (and, if possibile on selection). How can i do
it?

Thanks to all
francesco

-- 

3. alter table

4. android makefiles

5. some quesitions for new decoder integration process of opencore framework

6. best layout for app, dynamic set of 2 rows which consist of icons and text

7. graphics calculator