提交 6db3b489 authored 作者: 汪显鹏's avatar 汪显鹏

会议助手、语音助手 开发套件第一次提交

上级
# Created by .ignore support plugin (hsz.mobi)
/build/
此差异已折叠。
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.smdt.androidapi"
minSdkVersion 21
targetSdkVersion 28
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:support-v4:28.0.0'
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation files('lib/smdt.jar')
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}
<?xml version="1.0" encoding="utf-8"?>
<lint>
</lint>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.smdt.androidapi"
android:versionCode="1"
android:versionName="1.0">
<!--android:sharedUserId="android.uid.system"-->
<!--android:sharedUserId="android.uid.system"-->
<uses-permission android:name="android.permission.READ_FRAME_BUFFER" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.REBOOT" />
<uses-permission android:name="android.permission.MODIFY_PHONE_STATE" />
<uses-permission android:name="android.permission.DEVICE_POWER" />
<uses-permission android:name="android.permission.SHUTDOWN" />
<uses-permission android:name="android.permission.READ_FRAME_BUFFER" />
<uses-permission android:name="android.permission.WRITE_MEDIA_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.MOUNT_UNMOUNT_FILESYSTEMS" />
<uses-permission android:name="android.permission.CHANGE_NETWORK_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.SERIAL_PORT" />
<uses-permission android:name="android.permission.WRITE_SETTINGS" />
<uses-permission android:name="android.permission.WRITE_SECURE_SETTINGS" />
<uses-permission android:name="android.permission.INSTALL_PACKAGES" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_MEDIA_STORAGE" />
<uses-permission android:name="android.permission.SET_TIME" />
<uses-permission android:name="android.permission.STATUS_BAR" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_CACHE_FILESYSTEM" />
<uses-permission android:name="android.permission.DELETE_CACHE_FILES" />
<uses-permission android:name="android.permission.MODIFY_SOUND_SETTINGS" />
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
<uses-permission android:name="android.permission.RECOVERY" />
<uses-permission android:name="android.permission.BROADCAST_STICKY" />
<uses-permission android:name="android.permission.CONNECTIVITY_INTERNAL" />
<uses-permission android:name="android.permission.INTERACT_ACROSS_USERS" />
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:sharedUserId="android.uid.system"
android:theme="@style/AppTheme">
<activity
android:name=".MainActivity"
android:label="@string/app_name"
android:windowSoftInputMode="stateHidden|stateAlwaysHidden">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="com.smdt.androidapi.ScreenActivity" />
<activity android:name="com.smdt.androidapi.DevicesActivity" />
<activity android:name="com.smdt.androidapi.GpioActivity" />
<activity android:name="com.smdt.androidapi.WifiActivity" />
</application>
</manifest>
package com.smdt.androidapi;
import android.app.Activity;
import android.app.smdt.SmdtManager;
import android.os.Bundle;
import android.widget.TextView;
public class DevicesActivity extends Activity {
private TextView model,Android_version,running,inner,firware,kernel,version;
private SmdtManager smdt = null;
@Override
protected void onCreate(Bundle bundle) {
super.onCreate(bundle);
setContentView(R.layout.devices);
model = (TextView)findViewById(R.id.model);
Android_version = (TextView)findViewById(R.id.Android_version);
running = (TextView)findViewById(R.id.running);
inner = (TextView)findViewById(R.id.inner);
firware = (TextView)findViewById(R.id.firware);
kernel = (TextView)findViewById(R.id.kernel);
version = (TextView)findViewById(R.id.version);
smdt = SmdtManager.create(this);
model.setText("型号\n" + smdt.getAndroidModel());
Android_version.setText("Android版本\n" + smdt.getAndroidVersion());
running.setText("运行内存\n" + smdt.getRunningMemory());
inner.setText("内部存储\n" + smdt.getInternalStorageMemory());
firware.setText("固件版本\n" + smdt.getFirmwareVersion());
kernel.setText("内核版本\n" + smdt.getFormattedKernelVersion());
version.setText("版本号\n" + smdt.getAndroidDisplay());
}
}
package com.smdt.androidapi;
import android.app.Activity;
import android.app.smdt.SmdtManager;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;
public class GpioActivity extends Activity implements OnClickListener{
private Button btn_readGpio,btn_writeGpio;
private EditText tv_gpioNum;
private EditText tv_gpioValue;
private SmdtManager smdtManager;
private int gpioNum = 0;
private boolean bGpioValue;
private int ret;
@Override
protected void onCreate(Bundle bundle) {
super.onCreate(bundle);
setContentView(R.layout.gpio);
tv_gpioNum = (EditText)findViewById(R.id.tv_gpioNum);
btn_readGpio = (Button)findViewById(R.id.btn_readGpio);
btn_writeGpio = (Button)findViewById(R.id.btn_writeGpio);
tv_gpioValue = (EditText)findViewById(R.id.tv_gpioValue);
btn_readGpio.setOnClickListener(this);
btn_writeGpio.setOnClickListener(this);
smdtManager = SmdtManager.create(this);
}
@Override
public void onClick(View v) {
switch(v.getId()){
case R.id.btn_readGpio:
if (tv_gpioNum.getText().toString().equals(""))
{
Toast.makeText(getApplicationContext(), "gpio number is null", Toast.LENGTH_SHORT).show();
return;
}
gpioNum = Integer.parseInt(tv_gpioNum.getText().toString());
if ((gpioNum < 1) || (gpioNum > 10))
{
Toast.makeText(getApplicationContext(), "gpio number is not 1~10", Toast.LENGTH_SHORT).show();
return;
}
//smdtManager.smdtReadExtrnalGpioValue(gpioNum);
Toast.makeText(getApplicationContext(), smdtManager.smdtReadExtrnalGpioValue(gpioNum) + "", Toast.LENGTH_SHORT).show();
break;
case R.id.btn_writeGpio:
if (tv_gpioNum.getText().toString().equals("") || tv_gpioValue.getText().toString().equals(""))
{
Toast.makeText(getApplicationContext(), "gpio number or value is null", Toast.LENGTH_SHORT).show();
return;
}
gpioNum = Integer.parseInt(tv_gpioNum.getText().toString());
if (gpioNum < 1 || gpioNum > 10)
{
Toast.makeText(getApplicationContext(), "gpio number is not 1~10", Toast.LENGTH_SHORT).show();
return;
}
bGpioValue = (Integer.parseInt(tv_gpioValue.getText().toString())==1)?true:false;
ret = smdtManager.smdtSetExtrnalGpioValue(gpioNum, bGpioValue);
Log.d("lzl", "=========smdtSetExtrnalGpioValue is return " + ret + "=============");
//Toast.makeText(getApplicationContext(), smdtManager.smdtSetExtrnalGpioValue(gpioNum, bGpioValue) + "", Toast.LENGTH_SHORT).show();
break;
default:
break;
}
}
}
此差异已折叠。
package com.smdt.androidapi;
import android.app.Service;
import android.app.smdt.SmdtManager;
import android.content.Intent;
import android.os.IBinder;
public class MyService extends Service{
private SmdtManager smdt;
@Override
public IBinder onBind(Intent arg0) {
// TODO Auto-generated method stub
return null;
}
@Override
public void onStart(Intent intent, int startId) {
// TODO Auto-generated method stub
super.onStart(intent, startId);
smdt= SmdtManager.create(this);
smdt.smdtSetExtrnalGpioValue(1, true);
}
}
package com.smdt.androidapi;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.Date;
import android.annotation.SuppressLint;
import android.app.Activity;
import android.app.smdt.SmdtManager;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Matrix;
import android.media.MediaPlayer;
import android.net.Uri;
import android.os.Bundle;
import android.os.Environment;
import android.util.DisplayMetrics;
import android.util.Log;
import android.view.Display;
import android.view.Surface;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.widget.Button;
import android.widget.MediaController;
import android.widget.VideoView;
public class ScreenActivity extends Activity {
private Button btn_screen;
private VideoView videoView;
private SmdtManager smdt;
private String filePath = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES).getPath() + File.separator;
@Override
protected void onCreate(Bundle arg0) {
super.onCreate(arg0);
requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
setContentView(R.layout.screen);
btn_screen = (Button)findViewById(R.id.btn_screen);
videoView = (VideoView)findViewById(R.id.videoView);
final String sdPath = Environment.getExternalStorageDirectory().getPath().toString() + File.separator + "1.mp4";
File file = new File(sdPath);
Log.e("sdPath", "===file:" + file + ", sdPath: " + sdPath );
if(file.exists()){
videoView.setMediaController(new MediaController(this));
videoView.setVideoPath(sdPath);
// videoView.setVideoURI(Uri.parse("http://mvvideo1.meitudata.com/572552eaf0d841441.mp4"));
videoView.start();
videoView.requestFocus();
videoView.setOnPreparedListener(new MediaPlayer.OnPreparedListener() {
@Override
public void onPrepared(MediaPlayer mp) {
mp.start();
mp.setLooping(true);
}
});
videoView.setOnCompletionListener(new MediaPlayer.OnCompletionListener() {
@Override
public void onCompletion(MediaPlayer arg0) {
videoView.setVideoPath(sdPath);
videoView.start();
}
});
}
btn_screen.setOnClickListener(new View.OnClickListener() {
@SuppressLint("SimpleDateFormat")
@Override
public void onClick(View arg0) {
smdt = SmdtManager.create(getApplicationContext());
SimpleDateFormat sdformats = new SimpleDateFormat("yyyy-MM-dd-HH-mm-ss-SSS");
String fileNames = sdformats.format(new Date(System.currentTimeMillis())) + ".png";
smdt.smdtTakeScreenshot(filePath, fileNames, getApplicationContext());
}
});
}
}
package com.smdt.androidapi;
import android.app.Activity;
import android.app.smdt.SmdtManager;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
public class WifiActivity extends Activity implements OnClickListener{
private Button open,close;
private SmdtManager smdtManager;
@Override
protected void onCreate(Bundle arg0) {
super.onCreate(arg0);
setContentView(R.layout.wifi);
open = (Button)findViewById(R.id.btn_openwifi);
close = (Button)findViewById(R.id.btn_closewifi);
open.setOnClickListener(this);
close.setOnClickListener(this);
smdtManager = SmdtManager.create(this);
}
@Override
public void onClick(View v) {
switch(v.getId()){
case R.id.btn_openwifi:
smdtManager.getWifiInterface(getApplicationContext()).wifiOpen();
break;
case R.id.btn_closewifi:
smdtManager.getWifiInterface(getApplicationContext()).wifiClose();
break;
default:
break;
}
}
}
此差异已折叠。
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="84dp"
android:layout_marginTop="104dp"
android:orientation="vertical" >
<TextView
android:id="@+id/model"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="24dp"
android:textSize="36sp"
android:text="@string/model"/>
<TextView
android:id="@+id/Android_version"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="24dp"
android:textSize="36sp"
android:text="@string/android_version"/>
<TextView
android:id="@+id/running"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="24dp"
android:textSize="36sp"
android:text="@string/running"/>
<TextView
android:id="@+id/inner"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="24dp"
android:textSize="36sp"
android:text="@string/inner"/>
<TextView
android:id="@+id/firware"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="24dp"
android:textSize="36sp"
android:text="@string/firware"/>
<TextView
android:id="@+id/kernel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="24dp"
android:textSize="36sp"
android:text="@string/kernel"/>
<TextView
android:id="@+id/version"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="24dp"
android:textSize="36sp"
android:text="@string/version"/>
</LinearLayout>
</LinearLayout>
</ScrollView>
\ No newline at end of file
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:layout_marginLeft="440dp"
android:gravity="center" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="24dp"
android:orientation="horizontal" >
<Button
android:id="@+id/btn_readGpio"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="24dp"
android:text="@string/read_gpio"/>
<Button
android:id="@+id/btn_writeGpio"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="24dp"
android:text="@string/write_gpio"/>
<EditText
android:id="@+id/tv_gpioNum"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="34dp"
android:numeric="integer"
android:hint="@string/gpio_num"/>
<EditText
android:id="@+id/tv_gpioValue"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="34dp"
android:numeric="integer"
android:hint="@string/write_gpio_value"/>
</LinearLayout>
</LinearLayout>
\ No newline at end of file
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin" >
<VideoView
android:id="@+id/videoView"
android:layout_width="700dp"
android:layout_height="600dp" />
<ImageView
android:id="@+id/iv"
android:layout_width="1400dp"
android:layout_height="400dp"
android:layout_toRightOf="@id/videoView"
android:layout_marginLeft="30dp"
android:layout_alignBaseline="@id/videoView"
android:background="@drawable/smdt" />
<Button
android:id="@+id/btn_screen"
android:layout_width="400dp"
android:layout_height="60dp"
android:layout_below="@id/videoView"
android:layout_marginTop="20dp"
android:text="截图" />
<TextView
android:id="@+id/discrible"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:maxEms="38"
android:textSize="36sp"
android:textStyle="bold"
android:text="@string/smdt"
android:layout_marginTop="70dp"
android:layout_below="@id/btn_screen"/>
</RelativeLayout>
\ No newline at end of file
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="164dp"
android:layout_marginTop="164dp"
android:orientation="vertical" >
<Button
android:id="@+id/btn_openwifi"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/openwifi" />
<Button
android:id="@+id/btn_closewifi"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="36dp"
android:text="@string/closewifi"/>
</LinearLayout>
\ No newline at end of file
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
tools:context="com.smdt.androidapi.MainActivity" >
<item
android:id="@+id/action_settings"
android:orderInCategory="100"
android:showAsAction="never"
android:title="@string/action_settings"/>
</menu>
<resources>
<!--
Base application theme for API 11+. This theme completely replaces
AppBaseTheme from res/values/styles.xml on API 11+ devices.
-->
<style name="AppBaseTheme" parent="android:Theme.Holo.Light">
<!-- API 11 theme customizations can go here. -->
</style>
</resources>
<resources>
<!--
Base application theme for API 14+. This theme completely replaces
AppBaseTheme from BOTH res/values/styles.xml and
res/values-v11/styles.xml on API 14+ devices.
-->
<style name="AppBaseTheme" parent="android:Theme.Holo.Light.DarkActionBar">
<!-- API 14 theme customizations can go here. -->
</style>
</resources>
<resources>
<!--
Example customization of dimensions originally defined in res/values/dimens.xml
(such as screen margins) for screens with more than 820dp of available width. This
would include 7" and 10" devices in landscape (~960dp and ~1280dp respectively).
-->
<dimen name="activity_horizontal_margin">64dp</dimen>
</resources>
<resources>
<!-- Default screen margins, per the Android Design guidelines. -->
<dimen name="activity_horizontal_margin">16dp</dimen>
<dimen name="activity_vertical_margin">16dp</dimen>
</resources>
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">AndroidApi</string>
<string name="hello_world">Hello world!</string>
<string name="action_settings">Settings</string>
<string name="versions_name">API版本号</string>
<string name="can_not_find_version_name">找不到API版本号</string>
<string name="interface_shutdown">关机</string>
<string name="interface_getipaddr">获取IP</string>
<string name="interface_setpowerofftime">更改设置时间(先输入值,然后再点击按钮)</string>
<string name="btn_screen">截屏</string>
<string name="model">类型</string>
<string name="android_version">Android版本</string>
<string name="running">运行内存</string>
<string name="inner">内部存储</string>
<string name="firware">固件版本</string>
<string name="kernel">内核版本</string>
<string name="version">版本号</string>
<string name="openwifi">打开wifi</string>
<string name="closewifi">关闭wifi</string>
<string name="connectwifi">连接wifi</string>
<string name="disconnectwifi">断开wifi</string>
<string name="et_year">年份</string>
<string name="et_month">月份</string>
<string name="et_day">哪天</string>
<string name="et_hour">关机时间(14:20)</string>
<string name="et_minute">开机时间14:30)</string>
<string name="et_enable">是否设置定时开关机</string>
<string name="edit_setBright">设置亮度</string>
<string name="smdt">深圳市视美泰技术股份有限公司,一直致力于商显智能主板及整体解决方案研发,为商显行业提供智能主板软硬件平台、O2O智能零售设备、及设备运营平台。
服务领域:智能数字标牌、智能零售终端、智能快递柜、虚拟显示设备、机器人、智能家居设备。
面向物联网IOT,以不断发展和积累的技术优势及生产管理经验,保障产品品质和技术服务。</string>
<string name="usb_num">usb口(1~3)</string>
<string name="gpio_num">gpio口(1~10)</string>
<string name="read_gpio">读GPIO</string>
<string name="write_gpio">写GPIO(1~10)</string>
<string name="write_gpio_value">写GPIO值(0 or 1)</string>
<string name="open_eth_power">开以太网电源</string>
<string name="close_eth_power">关以太网电源</string>
<string name="get_eth_status">获取以太网状态</string>
<string name="eth_status">以太网状态</string>
<string name="three_poweronoff">3分钟开3分钟关</string>
<string name="HeadsetMic">耳机mic</string>
<string name="MicOn">mic开</string>
<string name="MicOff">mic关</string>
<string-array name="uart_path" >
<item>uart1</item>
<item>uart2</item>
<item>uart3</item>
<item>uart4</item>
<item>uart5</item>
<item>uart6</item>
</string-array>
</resources>
<resources>
<!--
Base application theme, dependent on API level. This theme is replaced
by AppBaseTheme from res/values-vXX/styles.xml on newer devices.
-->
<style name="AppBaseTheme" parent="android:Theme.Light">
<!--
Theme customizations available in newer API levels can go in
res/values-vXX/styles.xml, while customizations related to
backward-compatibility can go here.
-->
</style>
<!-- Application theme. -->
<style name="AppTheme" parent="AppBaseTheme">
<!-- All customizations that are NOT specific to a particular API-level can go here. -->
</style>
</resources>
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论