Re: [android-developers] Parse JSON using GSON library

2012-02-18 Thread Kristopher Micinski
http://lmgtfy.com/?q=gson+example

kris

On Sun, Feb 19, 2012 at 2:16 AM, Passion Android
 wrote:
> this is my JSON     --      {\"id\":12,\"name\":12,\"status\":\"ok\",
> \"volumes\":[{\"id\":17592,\"name\":\"root\",\"status\":\"ok\"}]}
> i want to parse it by using GSON how to do it just give me the demo.If
> u provide me the sample code it will be easier.
> Thanks
> Rickky Litao
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Parse JSON using GSON library

2012-02-18 Thread Passion Android
this is my JSON --  {\"id\":12,\"name\":12,\"status\":\"ok\",
\"volumes\":[{\"id\":17592,\"name\":\"root\",\"status\":\"ok\"}]}
i want to parse it by using GSON how to do it just give me the demo.If
u provide me the sample code it will be easier.
Thanks
Rickky Litao

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] parse JSON image url to GalleryView

2011-11-05 Thread Muchamad Jeffri
hello i want to ask make galleryview look like on android market.
this my code.

gridadapter
public class GridAdapter extends BaseAdapter {
int resource;
private ArrayList gm;
private Activity activity;
String response;
Context context;
public ImageLoader imageLoader;

public GridAdapter(Activity a, int resource, ArrayList gm)
{
this.gm = gm;
this.activity = a;
this.resource = resource;
this.imageLoader = new
ImageLoader(activity.getApplicationContext());
}

@Override
public int getCount() {
// TODO Auto-generated method stub
return gm.size();
}

@Override
public Object getItem(int position) {
// TODO Auto-generated method stub
return null;
}

@Override
public long getItemId(int position) {
// TODO Auto-generated method stub
return 0;
}

public GridModel getGridModel(int position) {
return gm.get(position);
}

public void setGridArray(ArrayList gm) {
this.gm = gm;
}

static class ViewHolder {
TextView name;
TextView jarak;
ImageView imgIcon;
}

@Override
public View getView(int position, View convertView, ViewGroup parent)
{
ViewHolder holder;
View v = convertView;

if(v==null){
LayoutInflater vi =
(LayoutInflater)activity.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
v = vi.inflate(resource, null);
holder = new ViewHolder();
holder.name = (TextView)v.findViewById(R.id.name);
holder.jarak = (TextView)v.findViewById(R.id.jarak);
holder.imgIcon = 
(ImageView)v.findViewById(R.id.imgIcon);

v.setTag(holder);
}
else
holder = (ViewHolder)v.getTag();
GridModel gms = gm.get(position);
if(gm!=null){
holder.name.setText(gms.getName());
holder.jarak.setText(gms.getJarak());

try{
holder.imgIcon.setTag(gms.getImageUrl());
imageLoader.displayImage(gms.imageUrl, 
activity, holder.imgIcon);
}catch (Exception e) {
// TODO: handle exception
}
}

return v;
}
void log(String text){
Log.e("GridAdapter", text);
}
}


gallery activity

public class Details extends Activity {
Bundle extras;
Gallery gallery1;
GridAdapter gridAdapter;
ArrayList listArray = null;
ImageLoader imgLoad;

@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
setContentView(R.layout.details);

gallery1 = (Gallery) findViewById(R.id.gallery1);
listArray = new ArrayList();

gallery1.setAdapter(gridAdapter);
gallery1.setOnItemClickListener(new OnItemClickListener() {

@Override
public void onItemClick(AdapterView arg0, View arg1, 
int arg2,
long arg3) {
// TODO Auto-generated method stub

}
});

extras = getIntent().getExtras();

try {
String response = extras.getString("json");
String judul = extras.getString("judul");
TextView txtJudul = (TextView) findViewById(R.id.judul);
txtJudul.setText(judul);

JSONObject json = new JSONObject(response);
JSONArray jArray = json.getJSONArray("provinsi");
Log.e("json", jArray.length() + "");
listArray = new ArrayList();

for (int i = 0; i < jArray.length(); i++) {
JSONObject jObject = jArray.getJSONObject(i);
JSONArray jSub = 
jObject.getJSONArray("gallery");

if (!jObject.getString("name").equals(judul))
continue;

Log.e("jsongallery", jSub.length() + "");
for (int j = 0; j < jSub.length(); j++) {
JSONObject jGallery = 
j

[android-developers] Parse JSON to Grid Layout

2011-11-02 Thread Muchamad Jeffri

hello, i want to ask how to parse JSON data to grid layout. look like
android market.
thanks.

http://4.bp.blogspot.com/-T0ubrNZd4ro/TlOx2EZGnXI/Ap0/p7PQWuJc8Ns/s400/MarketSwipe.png

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


Re: [android-developers] parse json response containing html tags

2011-03-22 Thread TreKing
On Tue, Mar 22, 2011 at 8:48 AM, Hitendrasinh Gohil <
hitendra.virtuei...@gmail.com> wrote:

> i am getting html tags in json response like, so how  i can parse
> it.
>

http://tinyurl.com/4k4weke

-
TreKing  - Chicago
transit tracking app for Android-powered devices

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] parse json response containing html tags

2011-03-22 Thread Hitendrasinh Gohil
hi,

i am getting html tags in json response like, so how  i can
parse it.

thankx

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Parse JSON

2008-09-20 Thread Nemat

Hi

Can anyone tell me the way I can parse JSON???

Thanks in advance...

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---