Both the Android emulator and smartphone can not run the application because of this exception, although I tested the connection which is well and Android can reach the neo4j database using neo4j browser on Chrome. And this is my maven verision, test code and error message.
implementation 'org.neo4j.driver:neo4j-java-driver:1.4.4';
Android SDK is 9.0(Pie) ,
gradel version is 3.4.2,
and maven-gradle-plugin version is 1.5
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.TextView;
import org.neo4j.driver.v1.*;
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Data test = new Data("bolt://holer.cc:50113", "neo4j", "12345");
}
}
class Data implements AutoCloseable{
private Driver driver;
private Session session;
public Data(String uri,String user,String password){
try {
driver = GraphDatabase.driver(uri, AuthTokens.basic(user, password));
session = driver.session();
} catch (Exception e) {
System.err.println(e);
}
}
public void close() throws Exception {
driver.close();
}
}
org.neo4j.driver.v1.exceptions.ServiceUnavailableException: Unable to process request: Permission denied