You Are Here:

Community: Developer Discussion Boards

#1 Old recordstore to list - 2006-11-27, 05:14

Join Date: Nov 2006
Posts: 9
cks
Offline
Registered User
hie.. im new in j2me.. i ned help on how to list down the database in recordstore into a menu list.. i hope some1 can help me out here...
Reply With Quote

#2 Old Post Re: recordstore to list - 2006-11-27, 06:12

Join Date: Apr 2006
Posts: 32
siva_guduru
Offline
Registered User
hey,
i exactly did not get ur question but i can help you one way.

generally if we think of populating list with records we need to provide the list constructor with some predeifned values u can get it by seeing jsr118 documentation of ur wtk2.2.

List(String title, int listType, String[] stringElements, Image[] imageElements)

so what u have to do is u have to populate this stringElements array with record store values.

in order to do this u need to open the record store of ur choice in a method and make that method return a string array.

u can open a record store with recorsstore.openrecordstore("record store name", true/false)

now after opening record store read the record store with the help of bytearrayinputstream and datainputstream .

for(int i = 1;i<=size;i++)
{
rs = RecordStore.openRecordStore(playListName,false);
ByteArrayInputStream bis = new ByteArrayInputStream(rs.getRecord(i));
DataInputStream dis = new DataInputStream(bis);
stringarray = dis.readUTF();
return stringarray;
}
rs.closeRecordStore();

catch the string array where u call this method;

stringaray[] = readmethod;

and provide this atring array to list constructor that s it.

hope u understand this,
with ragards,
siva_guduru.
Reply With Quote

#3 Old Re: recordstore to list - 2006-11-27, 09:45

Join Date: Nov 2006
Posts: 9
cks
Offline
Registered User
hie siva.. i did as u said..but can u explain more detail on this:

catch the string array where u call this method;

stringaray[] = readmethod;

and provide this atring array to list constructor that s it.


thanks
Reply With Quote

#4 Old Re: recordstore to list - 2006-11-28, 10:50

Join Date: Nov 2006
Posts: 9
cks
Offline
Registered User
i solved the problem... thanks
Reply With Quote
Reply « Previous Thread | Next Thread »
Display Modes
Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules

You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Forum Jump
Similar Threads
Thread Thread Starter Forum Replies Last Post
Startup Management list API for unprotected uids mateen_maldar Symbian User Interface 8 2006-09-27 10:32
Change the List type of the LIST ??? divyas Mobile Java General 2 2006-09-15 21:27
6680 and bluetooth service profiles ceruault Mobile Java Networking & Messaging & Security 1 2005-10-08 23:24
Bluetooth Virtual Serial Port mealos Bluetooth Technology 2 2004-12-03 04:46
List item selection SanDan Mobile Java General 2 2003-05-06 11:57

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia