Gravar dados celular

3 respostas
R

Sou iniciante em j2me e minha duvida é como gravar um registro no celular RMS para que quando o aplicativo java finalizar nao apagar todos os registros gerados pela minha aplicacao… estou querendo fazer um controle financeiro no celular porem preciso que fique gravado os registros para a proxima vez que eu acessar o aplicativo ele esteja disponivel… como fazer ?

3 Respostas

M

openRecordStore

public static RecordStore openRecordStore(String recordStoreName,
boolean createIfNecessary)
throws RecordStoreException,
RecordStoreFullException,
RecordStoreNotFoundException

Open (and possibly create) a record store associated with the given MIDlet suite. If this method is called by a MIDlet when the record store is already open by a MIDlet in the MIDlet suite, this method returns a reference to the same RecordStore object.

Parameters:
    recordStoreName - the MIDlet suite unique name for the record store, consisting of between one and 32 Unicode characters inclusive.
    createIfNecessary - if true, the record store will be created if necessary 
Returns:
    RecordStore object for the record store 
Throws:
    RecordStoreException - if a record store-related exception occurred 
    RecordStoreNotFoundException - if the record store could not be found 
    RecordStoreFullException - if the operation cannot be completed because the record store is full 
    IllegalArgumentException - if recordStoreName is invalid


Você encontra a API em :
C:\WTK22\docs\api\midp

R

Maluquo1, mas se eu criar uma recordstore e gravar varios registros nela, quando eu fechar o meu aplicativo java ele vai excluir estes dados (recordstore) tambem ?

M

nop, fica lá gravado, quando tu abrir denovo os dados vão estar lá.

Criado 13 de junho de 2007
Ultima resposta 14 de jun. de 2007
Respostas 3
Participantes 2