DelphiXE2 DataSnap com Android Erro ao pesquisar dados noapp

24/11/2015

2

Boa noite pessoal!

Estou desenvolvendo um app com conexao a um web service feito em delphi, no emulador pesquisa o dados tudo certinho! mas no celular o app nao funciona!
Alguma dica ?

Segue o codigo.

public ArrayList<Produto> GetArrayProduto() throws DBXException {
DSRESTConnection conn = getConnection();
TServerMethods1 serv = new TServerMethods1(conn);
TDataSet ds;

ArrayList<Produto> produtos = new ArrayList<Produto>();
try {

ds = serv.GetItem();
while (ds.next()) {
Produto p = new Produto();

Log.i("Lista Itens",
String.valueOf(ds.getValue("cod_item").GetAsString()));
p.setId(Integer.parseInt(ds.getValue("cod_item").GetAsString()));
p.setDescricao(ds.getValue("descricao").GetAsString());
p.setVl_Venda(Double.parseDouble(ds.getValue("vl_venda")
.GetAsString()));
produtos.add(p);
}

} finally {
}
return produtos;

}

public DSRESTConnection getConnection() {
DSRESTConnection conn = new DSRESTConnection();
conn.setHost(String.valueOf(config.getEndereco()));// ip do sevidor
conn.setPort(Integer.parseInt(config.getPorta()));
conn.setProtocol("http");
return conn;
}

log

1-13 00:48:22.816: W/System.err(1325): com.embarcadero.javaandroid.DBXException
11-13 00:48:22.816: W/System.err(1325): at com.embarcadero.javaandroid.DSRESTConnection.execute(DSRESTConnection.java:289)
11-13 00:48:22.816: W/System.err(1325): at com.embarcadero.javaandroid.DSProxy$TServerMethods1.GetPedidoVenda(DSProxy.java:374)
11-13 00:48:22.816: W/System.err(1325): at br.com.easymenu.pedido.venda.NovoPedido.IdPedidoVendaOld(NovoPedido.java:141
11-13 00:48:22.816: W/System.err(1325): at br.com.easymenu.pedido.venda.NovoPedido.access$9(NovoPedido.java:1406)
11-13 00:48:22.816: W/System.err(1325): at br.com.easymenu.pedido.venda.NovoPedido$2.onClick(NovoPedido.java:294)
11-13 00:48:22.816: W/System.err(1325): at android.view.View.performClick(View.java:3511)
11-13 00:48:22.816: W/System.err(1325): at android.view.View$PerformClick.run(View.java:14105)
11-13 00:48:22.816: W/System.err(1325): at android.os.Handler.handleCallback(Handler.java:605)
11-13 00:48:22.816: W/System.err(1325): at android.os.Handler.dispatchMessage(Handler.java:92)
11-13 00:48:22.816: W/System.err(1325): at android.os.Looper.loop(Looper.java:137)
11-13 00:48:22.816: W/System.err(1325): at android.app.ActivityThread.main(ActivityThread.java:4424)
11-13 00:48:22.816: W/System.err(1325): at java.lang.reflect.Method.invokeNative(Native Method)
11-13 00:48:22.816: W/System.err(1325): at java.lang.reflect.Method.invoke(Method.java:511)
11-13 00:48:22.816: W/System.err(1325): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
11-13 00:48:22.816: W/System.err(1325): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
11-13 00:48:22.816: W/System.err(1325): at dalvik.system.NativeStart.main(Native Method)
11-13 00:50:56.678: W/ActivityThread(156: Application br.com.easymenu is waiting for the debugger on port 8100...
Responder

Posts

25/11/2015

Aldemirmao

Resolvido!

Coloquei esse comando na Activity principal


this.getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
this.getWindow().clearFlags(
WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
Responder