É deve ser isso mesmo, andei conversando com umas pessoas , e vi que tenho transformar valores dinâmicos em estáticos.. vou porcurar por isso que falou.
obrigado
Cláudio
Em 5 de novembro de 2013 09:19, Carlos Eduardo <carloseduardopelegrin@gmail.com> escreveu:
Procure por tratamento de string e tratamento de double em java.Pelo visto é isso que você está com dificuldade!Att.
--
Carlos Eduardo Simões PelegrinEm 5 de novembro de 2013 09:16, Claudio <listas.arquivo@gmail.com> escreveu:E só pra entender minha linha no arquivo.txt tem valor igual ao abaixo, é uma stringlinha1 = "0001 0020 0240 0045";linha2 = "0015 0020 0240 0045";linha3 = "0030 0022 0240 0045";linha4 = "0045 0025 0240 0045";Vou ter que ler, separar esse valores para poder jogar em um método já pronto do Achartengine, para poder gerar um gráfico.x.add(new double[] { 1, 15, 30, 45 });
y1.add(new double[] { 20, 20, 22, 25 });y2.add(new double[] { 24.0, 24.0, 24.0, 24.0 });y3.add(new double[] { 45, 45, 45, 45 });
Eu quero tenho que pegar esse valor da string e deixar de forma que eu possa manipula-lo, em uma variavel, tipo o 240, dividir por 10... e então enfiar tudo dentro da lista. com valores estáticos já funciona.Cláudio--Em 5 de novembro de 2013 09:03, Carlos Eduardo <carloseduardopelegrin@gmail.com> escreveu:
já tentou vetor[i] = número?
att.
--
Carlos Eduardo Simões PelegrinEm 1 de novembro de 2013 11:30, Claudio . <listas.arquivo@gmail.com> escreveu:Olá.--Estou montando um gráfico, e os dados/valores devem preencher uma array list tipo : List<double[]> x = new ArrayList<double[]>();Se eu fosse colocar diretamente os valores assim: x.add(new double[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 }); funciona ok
Porém eu tenho que ler estes valor em um arquivo tx, e estou apanhando para converte-los, alguém poderia me mostrar o cainho?Tentei algo assim:linha = buffer.readLine()) // leio cada linha, coloco em uma variavel tipo stringstr = new String[] {linha}; //depois coloco em um array String str[]bx[c]=Integer.parseInt(str[n] + str[n+1] + str[n+2] + str[n+3]);// converto as strings que me interessam em inteiros
Estes valores eu gostaria de preencher a x.add(new double[] { -- AQUI--- })Bom devo estar fazendo algo bem errado, se alguém puder dar uma força.obrigado.Cláudio
You received this message because you are subscribed to the Google Groups "Android Brasil - Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to androidbrasil-dev+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
--
You received this message because you are subscribed to the Google Groups "Android Brasil - Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to androidbrasil-dev+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
You received this message because you are subscribed to the Google Groups "Android Brasil - Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to androidbrasil-dev+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
--
You received this message because you are subscribed to the Google Groups "Android Brasil - Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to androidbrasil-dev+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
You received this message because you are subscribed to the Google Groups "Android Brasil - Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to androidbrasil-dev+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.






0 comentários:
Postar um comentário