2

如何在android中实现城市飞艇?我从这里下载样本 。我运行我得到安装选项的应用程序。安装后我什么也没得到。实际上我不知道如何用android设置城市飞艇。我只是注册了一个应用名称 xxxx。我没有创建我的 xxxx 应用程序。但我对城市空中船的实施感到困惑。我需要在我的 xxxx 应用程序中触摸按钮,我必须列出我在城市飞艇上发布的视频。请帮我。

在上面的站点中,我得到了两个文件 MainActivity 和 sampleApplication。我不知道我在哪里使用我的 xxxx 应用程序中的代码。请帮我。

4

2 回答 2

5

在你的 AndroidManifest-

<receiver android:name="com.urbanairship.CoreReceiver">
            <intent-filter>
              <action android:name="android.intent.action.BOOT_COMPLETED" />
              <action android:name="android.intent.action.ACTION_SHUTDOWN" />
            </intent-filter>
        </receiver>

        <receiver android:name="com.urbanairship.push.c2dm.C2DMPushReceiver"
                android:permission="com.google.android.c2dm.permission.SEND">

          <intent-filter>
              <action android:name="com.google.android.c2dm.intent.RECEIVE" />
              <category android:name="com.your.app.here" />
          </intent-filter>

          <intent-filter>
              <action android:name="com.google.android.c2dm.intent.REGISTRATION" />
              <category android:name="com.your.app.here" />
          </intent-filter>
        </receiver>

        <service android:name="com.urbanairship.push.PushService" />

务必 -

import com.urbanairship.AirshipConfigOptions;
import com.urbanairship.UAirship;
import com.urbanairship.push.PushManager;

在您的活动或课程文件中 -

AirshipConfigOptions options = AirshipConfigOptions.loadDefaultOptions(this);
            options.developmentAppKey = "YOURAPPKEY";
            options.developmentAppSecret = "YOURAPPSECRET";
            options.productionAppKey = "";
            options.iapEnabled = false;
            options.inProduction = false; //determines which app key to use

            UAirship.takeOff(this.getApplication(), options);  
            PushManager.enablePush(); 

希望这可以帮助 :)

于 2012-06-01T13:31:49.123 回答
0

你可以通过这个。它详细描述了如何为 android 实现 urbanairship。

于 2014-07-17T06:07:49.883 回答