Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/vba/16.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
无法连接到android Studio上的解析服务器?_Android_Android Studio - Fatal编程技术网

无法连接到android Studio上的解析服务器?

无法连接到android Studio上的解析服务器?,android,android-studio,Android,Android Studio,可能是我遗漏了什么Android studio向我显示了错误 错误:com.parse.ParseRequest$ParseRequestException:i/o失败 下面是我的第一个文件 <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.m1.parsedemo

可能是我遗漏了什么Android studio向我显示了错误 错误:com.parse.ParseRequest$ParseRequestException:i/o失败

下面是我的第一个文件

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.m1.parsedemo">

    <uses-permission android:name="android.permission.INTERNET"/>
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

    <application
        android:name=".App"
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:supportsRtl="true"
        android:theme="@style/AppTheme">

        <activity android:name=".MainActivity">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>

</manifest>
并且App.java文件是

public class App extends Application {

    @Override
    public void onCreate() {
        super.onCreate();

        // Enable Local Datastore.
        Parse.enableLocalDatastore(this);

        // Add your initialization code here
        Parse.initialize(new Parse.Configuration.Builder(getApplicationContext())
                .applicationId("abc")
                .clientKey("xyz")
                .server("http://some_address:80/parse/")
                .build()
        );


        ParseUser.enableAutomaticUser();
        ParseACL defaultACL = new ParseACL();
        defaultACL.setPublicReadAccess(true);
        defaultACL.setPublicWriteAccess(true);
        ParseACL.setDefaultACL(defaultACL, true);

    }
}
我被困在这里我做错了什么?我正在学习android系列的rob教程,并下载了他们的应用程序,该程序运行良好,并连接到我的解析服务器,但上面有旧的解析sdk。
Thnx

您好,您可以按照此链接中的步骤操作,只需将应用程序id、客户端id和url更改为所需的url即可

从thi下载项目
我猜您是从rob percival学习的,这对我很有用,请尝试此链接

连接到AWS上的解析服务器
在androidstudio中,您应该在设置解析服务器时使用最新版本的androidstudio。如果您使用SSH客户端连接到实例。在实例信息中使用公共IPv4地址输入IP地址。之后,在SSH/AUTH处浏览密钥,并在终端中输入用户名:bitnami。要获取应用程序信息,请输入cd stack/parse,然后输入cat config.json。使用“http://ec2-4-150-20-8.us-east-2.compute.amazonaws.com:80/parse/“例如,在应用程序中输入服务器url。记住:80/parse在链接的末尾。要在web浏览器上检查服务器,请使用“http://ec2-4-150-20-8.us-east-2.compute.amazonaws.com/apps“例如,记住结尾处的/apps。使用默认用户名:user和password是要输入的主密钥

在X代码中,使用连接到应用程序中的实例时获得的服务器url。

url可能不正确。你确定你有一个正在运行的解析服务器吗?Url是正确的,我刚刚使用了虚拟Url。
 @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);


        ParseUser.getCurrentUser().logOut();
        ParseObject score = new ParseObject("Score");
        score.put("username", "manish");
        score.put("score", 862);
        score.saveInBackground(new SaveCallback() {
            @Override
            public void done(ParseException e) {

                if (e == null) {

                    Log.i("SaveInBackground", "Successful");

                } else {


                    Log.i("SaveInBackground", "Failed. Error: " + e.toString());

                }

            }
        });


        ParseAnalytics.trackAppOpenedInBackground(getIntent());
    }

}
public class App extends Application {

    @Override
    public void onCreate() {
        super.onCreate();

        // Enable Local Datastore.
        Parse.enableLocalDatastore(this);

        // Add your initialization code here
        Parse.initialize(new Parse.Configuration.Builder(getApplicationContext())
                .applicationId("abc")
                .clientKey("xyz")
                .server("http://some_address:80/parse/")
                .build()
        );


        ParseUser.enableAutomaticUser();
        ParseACL defaultACL = new ParseACL();
        defaultACL.setPublicReadAccess(true);
        defaultACL.setPublicWriteAccess(true);
        ParseACL.setDefaultACL(defaultACL, true);

    }
}