Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Takeya-Yuki
RubyLib
提交
b2f1f4a1
R
RubyLib
项目概览
Takeya-Yuki
/
RubyLib
8 个月 前同步成功
通知
39
Star
19
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
RubyLib
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
b2f1f4a1
编写于
8月 28, 2017
作者:
T
Takeya Yuki
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix
上级
7cc8cf6c
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
51 addition
and
3 deletion
+51
-3
app/build.gradle
app/build.gradle
+1
-1
app/src/main/java/jp/ruby/rubylibrary/MainActivity.java
app/src/main/java/jp/ruby/rubylibrary/MainActivity.java
+12
-0
app/src/main/java/jp/ruby/rubylibrary/TestService.java
app/src/main/java/jp/ruby/rubylibrary/TestService.java
+37
-1
rubylib/build.gradle
rubylib/build.gradle
+1
-1
未找到文件。
app/build.gradle
浏览文件 @
b2f1f4a1
...
...
@@ -2,7 +2,7 @@ apply plugin: 'com.android.application'
android
{
compileSdkVersion
26
buildToolsVersion
"26.0.
0
"
buildToolsVersion
"26.0.
1
"
defaultConfig
{
applicationId
"jp.ruby.rubylibrary"
minSdkVersion
21
...
...
app/src/main/java/jp/ruby/rubylibrary/MainActivity.java
浏览文件 @
b2f1f4a1
package
jp.ruby.rubylibrary
;
import
android.app.Activity
;
import
android.app.Notification
;
import
android.app.PendingIntent
;
import
android.content.Context
;
import
android.content.Intent
;
import
android.graphics.Color
;
...
...
@@ -19,11 +21,13 @@ import java.nio.charset.Charset;
import
java.util.Locale
;
import
yuki.control.extended.WebViewEx
;
import
yuki.msg.extended.NotificationController
;
import
yuki.resource.extended.GsonConvert
;
import
yuki.resource.extended.StorageIOManager
;
import
yuki.resource.extended.UIController
;
import
yuki.tts.extended.TTSComplexController
;
public
class
MainActivity
extends
Activity
{
@Override
...
...
@@ -36,6 +40,14 @@ public class MainActivity extends Activity {
wv
.
loadUrl
(
"http://10.1.1.134:8282/Client.html"
);
wv
.
addJavascriptInterface
(
new
TTSComplexController
(
getApplicationContext
(),
Locale
.
SIMPLIFIED_CHINESE
),
"tts"
);
//wv.addJavascriptInterface(new JS(getApplicationContext()), "tts");
Intent
i
=
new
Intent
(
Intent
.
ACTION_VIEW
,
Uri
.
parse
(
"http://www.baidu.com/"
));
PendingIntent
pi
=
PendingIntent
.
getActivity
(
getApplicationContext
(),
0
,
i
,
PendingIntent
.
FLAG_UPDATE_CURRENT
);
Intent
srv
=
new
Intent
(
"AAA"
);
srv
.
setPackage
(
getPackageName
());
startService
(
srv
);
NotificationController
.
Notify
(
getApplicationContext
(),
1
,
R
.
mipmap
.
ic_launcher
,
pi
,
"Ticker"
,
"Title"
,
"Content"
,
Notification
.
FLAG_NO_CLEAR
|
Notification
.
FLAG_AUTO_CANCEL
);
NotificationController
.
Notify
(
getApplicationContext
(),
1
,
R
.
mipmap
.
ic_launcher
,
pi
,
"Ticker2"
,
"Title2"
,
"Content2"
,
Notification
.
FLAG_NO_CLEAR
|
Notification
.
FLAG_AUTO_CANCEL
);
}
}
...
...
app/src/main/java/jp/ruby/rubylibrary/TestService.java
浏览文件 @
b2f1f4a1
package
jp.ruby.rubylibrary
;
import
android.app.Notification
;
import
android.app.PendingIntent
;
import
android.content.Intent
;
import
android.net.Uri
;
import
android.os.MemoryFile
;
import
java.io.IOException
;
import
yuki.msg.extended.NotificationController
;
import
yuki.msg.extended.YukiPushService
;
/**
* Created by Akeno on 2017/08/28.
*/
public
class
TestService
{
public
class
TestService
extends
YukiPushService
{
@Override
public
String
GetRemoteEndPoint
()
{
return
"10.1.1.134:10086"
;
}
@Override
public
int
GetIcon
(){
return
R
.
mipmap
.
ic_launcher
;
}
@Override
public
int
GetServiceID
(){
return
10
;
}
@Override
public
void
onCreate
(){
super
.
onCreate
();
}
@Override
public
void
MessagePushed
(
String
msg
)
{
Intent
j
=
new
Intent
(
Intent
.
ACTION_VIEW
,
Uri
.
parse
(
msg
));
j
.
setFlags
(
Intent
.
FLAG_ACTIVITY_NEW_TASK
);
startActivity
(
j
);
}
}
rubylib/build.gradle
浏览文件 @
b2f1f4a1
...
...
@@ -15,7 +15,7 @@ publish {
android
{
compileSdkVersion
26
buildToolsVersion
"26.0.
0
"
buildToolsVersion
"26.0.
1
"
defaultConfig
{
minSdkVersion
21
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录