How to read contents from XML file randomly

Put your problem here if it does not fit any of the other categories.

How to read contents from XML file randomly

Postby nisha » Mon Mar 10, 2008 7:00 am

Hi,
I have some content in xml file.. say some integer values... now i want to read those contents from XML file randomly...
Can we create any xml file in layout folder in res dynamically??? :?

Regards,
nisha :)
nisha
Experienced Developer
Experienced Developer
 
Posts: 80
Joined: Fri Feb 15, 2008 7:52 am

Top

Postby plusminus » Mon Mar 10, 2008 7:49 pm

Hello nisha,

I suggest reading in the values and selecting random after having done that.

Regards,
plusminus
Image
Image | Android Development Community / Tutorials
User avatar
plusminus
Site Admin
Site Admin
 
Posts: 2688
Joined: Wed Nov 14, 2007 8:37 pm
Location: Schriesheim, Germany

Postby nisha » Tue Mar 11, 2008 5:29 am

Hi,


Can i get some sample code for that??? :?

Regards,
nisha
nisha
Experienced Developer
Experienced Developer
 
Posts: 80
Joined: Fri Feb 15, 2008 7:52 am

Postby plusminus » Fri Mar 21, 2008 11:54 am

read all your values to an ArrayList and call [font=Lucida Console]myList.get(randomnumber_in_range_of_list);[/font]

Regards,
plusminus
Image
Image | Android Development Community / Tutorials
User avatar
plusminus
Site Admin
Site Admin
 
Posts: 2688
Joined: Wed Nov 14, 2007 8:37 pm
Location: Schriesheim, Germany

Top

Return to Other Coding-Problems

Who is online

Users browsing this forum: No registered users and 22 guests