Eclipse集成SDK

1.jar依赖集成

将下载的SDK中的eclipse/libs/iappease_v_xxx.jar复制到项目工程libs目录下。


      
├── libs
│   └── iappease_v_xxx.jar
└── src
 

2.资源文件文件集成

res目录下的资源文件放入您工程中相应的资源目录中.


      
├── libs
│   └── iappease_v_xxx.jar
├── res
    └── drawable
        ├── ixintui_back.png
        ├── ixintui_cancle.png
        └── ixintui_cancle2.png
    └── layout
        ├── ixintui_custom_notification.xml
        ├── ixintui_item_infoflow.xml
        ├── ixintui_item_infoflow_headstyle1.xml
        ├── ixintui_richpush_layout.xml
        └── ixintui_push_download.xml
    └── values
        └── ixintui_push_style.xml
    └── xml
        ├── ixintui_deamon.xml
        └── ixintui_sync.xml
 

2.1配置ixintui_sync.xml文件


      
1
2
3
4
5
6
7
8
9
10
<!-- 请把**yourpackage**替换成您的应用包名 -->
<?xml version="1.0" encoding="utf-8"?>
<sync-adapter xmlns:android="http://schemas.android.com/apk/res/android"
    android:accountType="com.ixintui.push.account"
    android:allowParallelSyncs="true"
    android:contentAuthority="**yourpackage**.provider"
    android:isAlwaysSyncable="true"
    android:supportsUploading="false"
    android:userVisible="true" />
 

3.配置AndroidManifest.xml文件


      
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
<!-- 加入红点通知Permission权限 -->
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="com.sec.android.provider.badge.permission.READ" />
<uses-permission android:name="com.sec.android.provider.badge.permission.WRITE" />
<uses-permission android:name="com.htc.launcher.permission.READ_SETTINGS" />
<uses-permission android:name="com.htc.launcher.permission.UPDATE_SHORTCUT" />
<uses-permission android:name="com.anddoes.launcher.permission.UPDATE_COUNT" />
<uses-permission android:name="com.majeur.launcher.permission.UPDATE_BADGE" />
<uses-permission android:name="com.huawei.android.launcher.permission.READ_SETTINGS" />
<uses-permission android:name="com.huawei.android.launcher.permission.CHANGE_BADGE" />
<uses-permission android:name="com.huawei.android.launcher.permission.WRITE_SETTINGS" />
<uses-permission android:name="com.sonyericsson.home.permission.RECEIVE_BADGE" />
<uses-permission android:name="com.sonyericsson.home.permission.BROADCAST_BADGE" />
<uses-permission android:name="com.android.launcher.permission.INSTALL_SHORTCUT"/>
<uses-permission android:name="com.android.launcher.permission.UNINSTALL_SHORTCUT"/>
<uses-permission android:name="com.android.launcher.permission.READ_SETTINGS"/>
 
<!-- 请确保您的应用具有以下Permission权限 -->
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.GET_TASKS" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.REORDER_TASKS" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.AUTHENTICATE_ACCOUNTS" />
<uses-permission android:name="android.permission.READ_SYNC_SETTINGS" />
<uses-permission android:name="android.permission.WRITE_SYNC_SETTINGS" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
 
<!-- 自定义一个Receiver,用来接收透传、api结果以及点击事件 -->
<!-- 请把**yourpackage**替换成您的应用包名 -->
<receiver android:name="xxx.xxx.PushReceiver">
    <intent-filter>
        <!-- 接收透传消息 -->
        <action android:name="com.ixintui.action.MESSAGE"/>
        <!-- 接收register, add tag等反馈消息 -->
        <action android:name="com.ixintui.action.RESULT"/>
        <!-- 接收notification click消息 -->
        <action android:name="com.ixintui.action.notification.CLICK"/>
    </intent-filter>
</receiver>
 
<!-- 以下为iappease使用的活动,服务和接收器 -->
<activity
      android:name="com.iappease.mozart.mobile.plugin.baseactivity"
      android:theme="@android:style/Theme.NoTitleBar" >
</activity>
 
<service android:name="com.iappease.mozart.mobile.plugin.baseservice_0" />
<service android:name="com.iappease.mozart.mobile.plugin.baseservice_1" />
<service android:name="com.iappease.mozart.mobile.plugin.baseservice_2" />
<service android:name="com.iappease.mozart.mobile.plugin.baseservice_3" />
<service android:name="com.iappease.mozart.mobile.plugin.baseservice_4" />
<service android:name="com.iappease.mozart.mobile.plugin.baseservice_5" />
 
<activity android:name="com.ixintui.push.PushActivity" android:theme="@android:style/Theme.Translucent.NoTitleBar" android:configChanges="orientation|keyboardHidden">
    <intent-filter>
        <action android:name="com.ixintui.push.PushActivity" />
        <category android:name="android.intent.category.DEFAULT" />
    </intent-filter>
</activity>
 
<service
    android:name="com.ixintui.push.PushService"
    android:exported="true"
    android:process=":ixintui_service_v1">
    <intent-filter>
        <action android:name="android.content.SyncAdapter" />
    </intent-filter>
    <meta-data
        android:name="android.content.SyncAdapter"
        android:resource="@xml/ixintui_sync" />
</service>
 
<service android:name="com.ixintui.push.MediateService" android:exported="true"></service>
 
<provider
    android:name="com.ixintui.push.Provider"
    android:exported="false"
    android:multiprocess="true"
    android:authorities="**yourpackage**.ixintui.push.provider"/>
 
<receiver android:name="com.ixintui.push.Receiver">
    <intent-filter>
        <action android:name="com.ixintui.action.BROADCAST" />
    </intent-filter>
    <intent-filter>
        <action android:name="android.intent.action.PACKAGE_REMOVED"/>
        <data android:scheme="package" />
    </intent-filter>
    <intent-filter >
        <action android:name="android.intent.action.BOOT_COMPLETED" />
        <action android:name="android.net.conn.CONNECTIVITY_CHANGE" />
    </intent-filter>
</receiver>
 
<activity
    android:name="com.ixintui.push.RichpushActivity"
    android:theme="@android:style/Theme.Translucent">
</activity>
<service android:name="com.ixintui.push.DeamonService">
    <intent-filter>
        <action android:name="android.accounts.AccountAuthenticator" />
    </intent-filter>
    <meta-data
        android:name="android.accounts.AccountAuthenticator"
        android:resource="@xml/ixintui_deamon" />
</service>
<!-- 请把**yourpackage**替换成您的应用包名 -->
<provider
    android:name="com.ixintui.push.SyncProvider"
    android:authorities="**yourpackage**.provider"
    android:exported="false"
    android:syncable="true" />
 

4.代码集成

代码集成参见Android Studio集成文档