diff --git a/OSSDKDemo/app/build.gradle b/OSSDKDemo/app/build.gradle
index e197c95..949a839 100644
--- a/OSSDKDemo/app/build.gradle
+++ b/OSSDKDemo/app/build.gradle
@@ -32,4 +32,5 @@ dependencies {
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
implementation files('libs/CloudserviceLib.jar')
+ implementation files('libs/PopupMessageLib.jar')
}
diff --git a/OSSDKDemo/app/libs/PopupMessageLib.jar b/OSSDKDemo/app/libs/PopupMessageLib.jar
new file mode 100644
index 0000000..aeda1b8
Binary files /dev/null and b/OSSDKDemo/app/libs/PopupMessageLib.jar differ
diff --git a/OSSDKDemo/app/src/main/AndroidManifest.xml b/OSSDKDemo/app/src/main/AndroidManifest.xml
index 0e4eb73..6d773a2 100644
--- a/OSSDKDemo/app/src/main/AndroidManifest.xml
+++ b/OSSDKDemo/app/src/main/AndroidManifest.xml
@@ -13,6 +13,7 @@
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
+
@@ -20,6 +21,10 @@
+
+
\ No newline at end of file
diff --git a/OSSDKDemo/app/src/main/assets/Wildlife.wmv b/OSSDKDemo/app/src/main/assets/Wildlife.wmv
new file mode 100755
index 0000000..bc3ff06
Binary files /dev/null and b/OSSDKDemo/app/src/main/assets/Wildlife.wmv differ
diff --git a/OSSDKDemo/app/src/main/assets/test.jpg b/OSSDKDemo/app/src/main/assets/test.jpg
new file mode 100644
index 0000000..bc45c7c
Binary files /dev/null and b/OSSDKDemo/app/src/main/assets/test.jpg differ
diff --git a/OSSDKDemo/app/src/main/java/com/jeejio/ossdk/demo/MainActivity.java b/OSSDKDemo/app/src/main/java/com/jeejio/ossdk/demo/MainActivity.java
index 2bb89ef..7c5fe2b 100644
--- a/OSSDKDemo/app/src/main/java/com/jeejio/ossdk/demo/MainActivity.java
+++ b/OSSDKDemo/app/src/main/java/com/jeejio/ossdk/demo/MainActivity.java
@@ -2,7 +2,9 @@
import androidx.appcompat.app.AppCompatActivity;
+import android.content.Intent;
import android.os.Bundle;
+import android.view.View;
public class MainActivity extends AppCompatActivity {
@@ -11,4 +13,8 @@ protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
+
+ public void start_pop(View view){
+ startActivity(new Intent(MainActivity.this, PopupMessageActivity.class));
+ }
}
diff --git a/OSSDKDemo/app/src/main/java/com/jeejio/ossdk/demo/PopupMessageActivity.java b/OSSDKDemo/app/src/main/java/com/jeejio/ossdk/demo/PopupMessageActivity.java
new file mode 100644
index 0000000..8f63358
--- /dev/null
+++ b/OSSDKDemo/app/src/main/java/com/jeejio/ossdk/demo/PopupMessageActivity.java
@@ -0,0 +1,80 @@
+package com.jeejio.ossdk.demo;
+
+import androidx.appcompat.app.AppCompatActivity;
+
+import android.os.Bundle;
+import android.util.Log;
+import android.view.View;
+import android.widget.Button;
+
+import jeejio.popup.PopUpMessageProvider;
+import jeejio.popup.PopupMessageImp;
+import jeejio.popup.PopupMessageManagerImp;
+
+public class PopupMessageActivity extends AppCompatActivity {
+
+ private String TAG = PopupMessageActivity.class.getSimpleName();
+ private PopupMessageManagerImp managerImp;
+ private Button local_picture, net_picture, local_video, net_video;
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_popup_message);
+ try {
+ managerImp = PopupMessageManagerImp.getInstance(getApplicationContext());
+ } catch (IllegalAccessException e) {
+ Log.e(TAG,"get PopupMessageService failed!");
+ e.printStackTrace();
+ return;
+ }
+
+ local_picture = findViewById(R.id.local_picture);
+ local_picture.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ PopupMessageImp imp = new PopupMessageImp.Builder(PopupMessageActivity.this)
+ .setContentTitle("本地图片")
+ .setContentPath(PopUpMessageProvider.parse(PopupMessageActivity.this,"test.jpg"))
+ .setContentType(PopupMessageManagerImp.POPUP_MESSAGE_PICTURE).build();
+ managerImp.notify(imp);
+ }
+ });
+
+ net_picture = findViewById(R.id.net_picture);
+ net_picture.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ PopupMessageImp imp = new PopupMessageImp.Builder(PopupMessageActivity.this)
+ .setContentTitle("山水美景")
+ .setContentPath("https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1606213359863&di=45e4efd5c301ecd244d6f87a8d6ce9b8&imgtype=0&src=http%3A%2F%2Fpic1.win4000.com%2Fwallpaper%2F2018-12-15%2F5c149eec524ff.jpg")
+ .setContentType(PopupMessageManagerImp.POPUP_MESSAGE_PICTURE).build();
+ managerImp.notify(imp);
+ }
+ });
+
+ local_video = findViewById(R.id.local_video);
+ local_video.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ PopupMessageImp imp = new PopupMessageImp.Builder(PopupMessageActivity.this)
+ .setContentTitle("视频")
+ .setContentPath(PopUpMessageProvider.parse(PopupMessageActivity.this,"Wildlife.wmv"))
+ .setContentType(PopupMessageManagerImp.POPUP_MESSAGE_VIDEO).build();
+ managerImp.notify(imp);
+ }
+ });
+
+ net_video = findViewById(R.id.net_video);
+ net_video.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ PopupMessageImp imp = new PopupMessageImp.Builder(PopupMessageActivity.this)
+ .setContentTitle("CCTV-1")
+ .setContentPath("http://ivi.bupt.edu.cn/hls/cctv1hd.m3u8")
+ .setContentType(PopupMessageManagerImp.POPUP_MESSAGE_VIDEO).build();
+ managerImp.notify(imp);
+ }
+ });
+ }
+
+}
diff --git a/OSSDKDemo/app/src/main/res/layout/activity_main.xml b/OSSDKDemo/app/src/main/res/layout/activity_main.xml
index c031404..4b9e692 100644
--- a/OSSDKDemo/app/src/main/res/layout/activity_main.xml
+++ b/OSSDKDemo/app/src/main/res/layout/activity_main.xml
@@ -1,15 +1,16 @@
-
-
+ android:text="@string/message_title"/>
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/OSSDKDemo/app/src/main/res/layout/activity_popup_message.xml b/OSSDKDemo/app/src/main/res/layout/activity_popup_message.xml
new file mode 100644
index 0000000..9ce3256
--- /dev/null
+++ b/OSSDKDemo/app/src/main/res/layout/activity_popup_message.xml
@@ -0,0 +1,30 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/OSSDKDemo/app/src/main/res/values/strings.xml b/OSSDKDemo/app/src/main/res/values/strings.xml
index 5bbcde4..fbad3b8 100644
--- a/OSSDKDemo/app/src/main/res/values/strings.xml
+++ b/OSSDKDemo/app/src/main/res/values/strings.xml
@@ -1,3 +1,8 @@
OSSDKDemo
+ 消息预览demo
+ 展示本地图片
+ 展示网络图片
+ 展示本地视频
+ 展示网络视频
diff --git a/README.md b/README.md
index 5e802c3..cb7fcc9 100644
--- a/README.md
+++ b/README.md
@@ -10,7 +10,9 @@ Jeejio OS 是一套基于 Android 的 IoT(物联网) 设备的操作系统,具
该SDK是一个使您可以轻松开发物端 APP 的开发者工具包,提供了与控制端 H5 交互和监听物端设备按键的功能,只需轻松几步即可使您的 APP 接入 Jeejio 云。
+### Popup Message SDK
+该SDk提供消息预览功能,在您的控制端您可以选择预览某个视频或图片,在物端就会为您展示10秒。
## 集成指南
@@ -20,16 +22,22 @@ Jeejio OS 是一套基于 Android 的 IoT(物联网) 设备的操作系统,具
- JeejioCloudService:云服务代理对象。您的APP可以通过此对象与 Jeejio 云服务建立链接。
- InputEventService:按键服务。您可以通过该服务来监听物端设备按键事件。
- OnInputEventListener:物端按键事件监听器,可以通过该监听器收到来物端按键的触发状态。
+- PopupMessageImp:消息主体,通过此类构建您需要预览的消息。
+- PopupMessageManagerImp:消息预览服务。
### 接入说明
- SDK下载
前往 [Github](https://github.com/jeejio/Jeejio-OS-SDK/tags) 下载最新版本。
-- Android SDK导入
+- Jeejio OS SDK导入
将下载下来的 `CloudserviceLib.jar` 放入 AndroidStudio 工程的 `libs` 目录下,并在 `app/build.gradle` 文件中加入 `implementation files('libs/CloudServiceLib.jar')`,即可完成导入。
+- Popup Message SDK导入
+
+ 将下载下来的 `PopupMessageLib.jar` 放入 AndroidStudio 工程的 `libs` 目录下,并在 `app/build.gradle` 文件中加入 `implementation files('libs/PopupMessageLib.jar')`,即可完成导入。
+
- 混淆规则
```properties
@@ -133,7 +141,31 @@ String userId = JeejioCloudService.getUserId(this);
Log.i(TAG, "userId = " + userId);
```
+**4、预览消息(以图片为例)**
+
+- 在AndroidManifest.xml中的标签中添加provider
+
+```java
+
+```
+
+- 获取manager示例
+```java
+PopupMessageManagerImp managerImp = PopupMessageManagerImp.getInstance(getApplicationContext());
+```
+
+- 弹出消息
+
+```java
+PopupMessageImp imp = new PopupMessageImp.Builder(PopupMessageActivity.this)
+ .setContentTitle("图片")
+ .setContentPath("地址")
+ .setContentType(PopupMessageManagerImp.POPUP_MESSAGE_PICTURE).build();
+managerImp.notify(imp);
+```
## 更新日志