Question

I don't know whether my question makes sense or not. But here is what I have done. First trial with Java application: - I created sample Java project. - Added jedis jar file to it. - Established a connection like,

Jedis jedis = new Jedis("my IP address");
    jedis.connect();
    String value = jedis.get("foo"); //I have set the value for "foo" in redis
    System.out.println(value); //successfully prints foo in console when ran as Java application

Now I tried the same thing in Android application, but it failed

setContentView(R.layout.activity_main_activity_jedis);
    Jedis jedis = new Jedis("my IP address");
    jedis.connect();
    String value = jedis.get("foo");
    TextView tv = (TextView)findViewById(R.id.text);
    tv.setText(value);

My aim is to get the data from Redis and display it in my Android application. Please help !

Était-ce utile?

La solution

This issue got resolved. I have added user-permissions for INTERNET in manifest file. Its working fine now. Thanks to all !

Autres conseils

Did you import it into the Eclipse project??

Right clic in the project > Properties > Java Build Path > Libraries > Add external JAR or other type you want... And active it into the "Order and export" tab...

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top