问题
Is there any way I can connect to a remote Neo4j server from an Android Project at all ? I have used several approaches: JDBC driver and through REST API using Jersey Client however none of these approaches are successful. All of these work in a pure Java project but fail miserably in Android. At this stage I lost hope that there exists a way I can talk to the database through android. Is that feasible or am I wasting my time trying to find impossible solution ?
回答1:
If Neo4j exposes an HTTP REST interface, then yes of course you can access it from Android. There are many different ways, including HTTPUrlConnection
and Apache HttpClient
.
If you want to use Jersey, there's no reason why that wouldn't work. I'd start with one of the above first though to prove to yourself that the basics work.
Here someone as written a Java binding to the REST API.
https://github.com/neo4j-contrib/java-rest-binding
You can use (most) Java libraries in Android.
来源:https://stackoverflow.com/questions/28552810/connect-to-neo4j-through-android-impossible-task