├── .DS_Store
├── .classpath
├── .gitignore
├── .project
├── .settings
├── .DS_Store
├── org.eclipse.core.resources.prefs
└── org.eclipse.jdt.core.prefs
├── AndroidManifest.xml
├── LICENSE
├── README.md
├── assets
└── UIConfig.json
├── effect.png
├── ic_launcher-web.png
├── libs
├── BLEasyConfig.jar
├── GizWifiSDK.jar
├── LSFSK_1.0.jar
├── Lark7618SDK_noudp1606031910_0101.jar
├── OneShotConfig.jar
├── android-support-v4.jar
├── armeabi
│ ├── .DS_Store
│ ├── libBLEasyConfig.so
│ ├── libSDKLog.so
│ ├── libbdpush_V2_6.so
│ ├── libbspatch.so
│ ├── libjpush215.so
│ ├── libsimpleconfiglib.so
│ └── libwavegen.so
├── easylink2.0.jar
├── hiflying-iots-android-smartlink7.0.2.jar
├── jpush-android-2.1.5.jar
├── libEsptouch_v0.3.3.4_3.jar
├── libForEElink.jar
├── libammsdk.jar
├── mta-sdk-1.6.2.jar
├── open_sdk_r5756.jar
├── pushservice-5.0.0.66.jar
├── simpleconfigwizardlib.jar
├── volley-1.0.19.jar
├── xUtils-2.6.14.jar
└── zxing.jar
├── proguard-project.txt
├── project.properties
├── res
├── drawable-hdpi
│ ├── ic_launcher.png
│ ├── ic_richpush_actionbar_back.png
│ ├── ic_richpush_actionbar_divider.png
│ ├── open_perecent_bg.png
│ └── richpush_btn_selector.xml
├── drawable-mdpi
│ └── ic_launcher.png
├── drawable-xhdpi
│ ├── about_icon.png
│ ├── add.png
│ ├── arrow.png
│ ├── back_bt.png
│ ├── back_bt_.png
│ ├── barcode_frame.png
│ ├── barcode_laser_line.png
│ ├── button_back.png
│ ├── button_blue_long.png
│ ├── button_invisible.png
│ ├── button_more.png
│ ├── button_not_sure.png
│ ├── button_refresh.png
│ ├── button_setting.png
│ ├── button_sure.png
│ ├── button_visible.png
│ ├── checkmark.png
│ ├── comd1_btn_menu.png
│ ├── comd1_home_bnt_off.png
│ ├── comd1_home_bnt_on.png
│ ├── comd1_home_btn_color.png
│ ├── comd1_home_btn_color_temperature.png
│ ├── comd1_home_icon_brightness.png
│ ├── comd1_home_icon_light.png
│ ├── comd1_home_icon_tab.png
│ ├── comd1_icon_return.png
│ ├── comd1_light_sewen_bg2.png
│ ├── comd1_more_icon_name.png
│ ├── comd1_more_icon_schedule.png
│ ├── comd1_more_icon_timer.png
│ ├── comd_arrow_right_gray.png
│ ├── comd_home_icon_timer.png
│ ├── comd_ic_clear.png
│ ├── comd_icon_return.png
│ ├── comd_more_icon.png
│ ├── comd_more_icon_name.png
│ ├── comd_more_icon_schedule.png
│ ├── comd_more_icon_timer.png
│ ├── comd_power_off.png
│ ├── comd_power_on.png
│ ├── comd_reservation_button.png
│ ├── comd_timer_btn_add.png
│ ├── comd_tips_box.png
│ ├── comd_top.png
│ ├── device_icon.png
│ ├── failsoft.png
│ ├── ic_launcher.png
│ ├── login_password.png
│ ├── logo3.png
│ ├── mymyshoft.png
│ ├── nodevice.png
│ ├── noselect.png
│ ├── phone.png
│ ├── qq.png
│ ├── right_icon.png
│ ├── select.png
│ ├── sms.png
│ ├── splash.png
│ ├── splash_light.png
│ ├── sub.png
│ ├── test_comd1_light_sewen_bg2.png
│ ├── wechat.png
│ └── wifi_icon.png
├── drawable-xxhdpi
│ └── ic_launcher.png
├── drawable
│ ├── airlink.gif
│ ├── alert_bottom_left_shape.xml
│ ├── alert_bottom_right_shape.xml
│ ├── alert_top_shape.xml
│ ├── border_layer_list.xml
│ ├── btn_getcode_shape.xml
│ ├── btn_getcode_shape_gray.xml
│ ├── button_shape_gray.xml
│ ├── checkbox_hook_selector.xml
│ ├── checkbox_laws_selector.xml
│ ├── comd_btn_remove_device.xml
│ ├── comd_selector_power.xml
│ ├── comd_switch_off2.png
│ ├── comd_switch_on2.png
│ ├── comd_toggle_selector2.xml
│ ├── devicelist_item_selector.xml
│ ├── resetsoftap.gif
│ ├── round_rect.xml
│ ├── seek_bar.png
│ ├── seek_bar1.png
│ ├── selector_mode.xml
│ └── selector_power.xml
├── layout
│ ├── activity_comd_device_more.xml
│ ├── activity_comd_edit_device_alias.xml
│ ├── activity_comd_light_device_control.xml
│ ├── activity_comd_schedule_edit_action.xml
│ ├── activity_comd_schedule_edit_date.xml
│ ├── activity_comd_schedule_edit_device_delay.xml
│ ├── activity_comd_schedule_edit_repeat.xml
│ ├── activity_comd_schedule_list.xml
│ ├── activity_gos_about.xml
│ ├── activity_gos_airlink_choose_device_workwifi.xml
│ ├── activity_gos_airlink_config_countdown.xml
│ ├── activity_gos_capture.xml
│ ├── activity_gos_check_device_workwifi.xml
│ ├── activity_gos_choose_device.xml
│ ├── activity_gos_colorlist.xml
│ ├── activity_gos_config_countdown.xml
│ ├── activity_gos_config_failed.xml
│ ├── activity_gos_device_control.xml
│ ├── activity_gos_device_list.xml
│ ├── activity_gos_device_ready.xml
│ ├── activity_gos_forget_password.xml
│ ├── activity_gos_modelist.xml
│ ├── activity_gos_register_user.xml
│ ├── activity_gos_settings.xml
│ ├── activity_gos_user_login.xml
│ ├── actvity_gos_airlink_ready.xml
│ ├── actvity_gos_device_reset.xml
│ ├── alert_gos_empty.xml
│ ├── alert_gos_logout.xml
│ ├── alert_gos_new_device.xml
│ ├── alert_gos_quit.xml
│ ├── alert_gos_wifi_list.xml
│ ├── dialog_comd_unbind_device.xml
│ ├── item_comd_listview_with_checkbox.xml
│ ├── item_comd_schedule_list.xml
│ ├── item_gos_device_list.xml
│ ├── item_gos_mode_list.xml
│ ├── item_gos_wifi_list.xml
│ ├── jpush_popwin_layout.xml
│ ├── jpush_webview_layout.xml
│ ├── view_gos_notification.xml
│ └── view_gos_title_listview.xml
├── menu
│ ├── devicelist_login.xml
│ └── devicelist_logout.xml
├── values-en
│ ├── arrays_mode.xml
│ └── strings.xml
├── values-v11
│ └── styles.xml
├── values-v14
│ └── styles.xml
├── values-w820dp
│ └── dimens.xml
└── values
│ ├── arrays_mode.xml
│ ├── attrs.xml
│ ├── colors.xml
│ ├── dimens.xml
│ ├── ids.xml
│ ├── jpush_style.xml
│ ├── strings.xml
│ └── styles.xml
└── src
├── com
└── gizwits
│ └── opensource
│ ├── appkit
│ ├── CommonModule
│ │ ├── GosBaseActivity.java
│ │ ├── GosDeploy.java
│ │ └── WifiAutoConnectManager.java
│ ├── ConfigModule
│ │ ├── GosAirlinkChooseDeviceWorkWiFiActivity.java
│ │ ├── GosAirlinkConfigCountdownActivity.java
│ │ ├── GosAirlinkReadyActivity.java
│ │ ├── GosCheckDeviceWorkWiFiActivity.java
│ │ ├── GosChooseDeviceActivity.java
│ │ ├── GosConfigCountdownActivity.java
│ │ ├── GosConfigFailedActivity.java
│ │ ├── GosConfigModuleBaseActivity.java
│ │ ├── GosDeviceReadyActivity.java
│ │ ├── GosDeviceResetActivity.java
│ │ ├── GosModeListActivity.java
│ │ └── GosWifiChangeReciver.java
│ ├── ControlModule
│ │ └── GosDeviceControlActivity.java
│ ├── DeviceModule
│ │ ├── GosDeviceListActivity.java
│ │ ├── GosDeviceListAdapter.java
│ │ ├── GosDeviceModuleBaseActivity.java
│ │ └── GosMessageHandler.java
│ ├── GosApplication.java
│ ├── PushModule
│ │ ├── BaiDuPushReceiver.java
│ │ ├── GosPushManager.java
│ │ └── JPushReceiver.java
│ ├── SettingsModule
│ │ ├── GosAboutActivity.java
│ │ └── GosSettiingsActivity.java
│ ├── ThirdAccountModule
│ │ └── BaseUiListener.java
│ ├── UserModule
│ │ ├── GosForgetPasswordActivity.java
│ │ ├── GosRegisterUserActivity.java
│ │ ├── GosUserLoginActivity.java
│ │ └── GosUserModuleBaseActivity.java
│ ├── utils
│ │ ├── HTTPSTrustManager.java
│ │ ├── JsonUtils.java
│ │ ├── NetUtils.java
│ │ └── TrustAllSSLSocketFactory.java
│ ├── view
│ │ ├── DotView.java
│ │ ├── GifView.java
│ │ ├── RoundProgressBar.java
│ │ └── SlideListView2.java
│ └── wxapi
│ │ └── WXEntryActivity.java
│ └── devicecontrol
│ ├── date
│ └── GosScheduleData.java
│ ├── tools
│ ├── GetUTCTimeUtil.java
│ └── GosScheduleSiteTool.java
│ └── ui
│ ├── activity
│ ├── GosDeviceControlActivity.java
│ ├── GosDeviceControlModuleBaseActivity.java
│ ├── GosDeviceMoreActivity.java
│ ├── GosEditDeviceAliasActivity.java
│ ├── GosEditDeviceDelayActivity.java
│ ├── GosScheduleEditActionAcitvity.java
│ ├── GosScheduleEditDateAcitivty.java
│ ├── GosScheduleEditRepeatActivity.java
│ └── GosScheduleListActivity.java
│ ├── adapter
│ ├── GosScheduleCheckBoxListAdapter.java
│ ├── GosScheduleCheckBoxListDateHolder.java
│ ├── GosScheduleListAdapter.java
│ ├── GosScheduleViewHolder.java
│ └── SlideListView.java
│ ├── utils
│ └── DensityUtils.java
│ └── view
│ ├── ColorCircularSeekBar.java
│ └── ColorTempCircularSeekBar.java
└── zxing
├── CaptureActivity.java
├── camera
├── AutoFocusManager.java
├── CameraConfigurationManager.java
├── CameraManager.java
├── PreviewCallback.java
└── open
│ └── OpenCameraInterface.java
├── decoding
├── DecodeFormatManager.java
├── DecodeHandler.java
└── DecodeThread.java
└── utils
├── CaptureActivityHandler.java
└── InactivityTimer.java
/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gizwits/Gizwits-SmartBuld_Android/47ff43a52e8f709850a6b80f62dc8cdd8af7b610/.DS_Store
--------------------------------------------------------------------------------
/.classpath:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | /bin/gen
2 | /bin
3 | /gen
4 |
--------------------------------------------------------------------------------
/.project:
--------------------------------------------------------------------------------
1 |
2 |
3 | Gizwits-SmartBuld_Android
4 |
5 |
6 |
7 |
8 |
9 | com.android.ide.eclipse.adt.ResourceManagerBuilder
10 |
11 |
12 |
13 |
14 | com.android.ide.eclipse.adt.PreCompilerBuilder
15 |
16 |
17 |
18 |
19 | org.eclipse.jdt.core.javabuilder
20 |
21 |
22 |
23 |
24 | com.android.ide.eclipse.adt.ApkBuilder
25 |
26 |
27 |
28 |
29 |
30 | com.android.ide.eclipse.adt.AndroidNature
31 | org.eclipse.jdt.core.javanature
32 |
33 |
34 |
--------------------------------------------------------------------------------
/.settings/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gizwits/Gizwits-SmartBuld_Android/47ff43a52e8f709850a6b80f62dc8cdd8af7b610/.settings/.DS_Store
--------------------------------------------------------------------------------
/.settings/org.eclipse.core.resources.prefs:
--------------------------------------------------------------------------------
1 | eclipse.preferences.version=1
2 | encoding/=UTF-8
3 |
--------------------------------------------------------------------------------
/.settings/org.eclipse.jdt.core.prefs:
--------------------------------------------------------------------------------
1 | eclipse.preferences.version=1
2 | org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
3 | org.eclipse.jdt.core.compiler.compliance=1.6
4 | org.eclipse.jdt.core.compiler.source=1.6
5 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2015 GizWits
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # GizOpenSource-SmartLight_Android
2 | ==================
3 |
4 | ## 介绍
5 |
6 | 这是一款可以帮助开发者快速使用GizWifiSDK,连接到机智云的开源物联示例APP,该APP针对的是智能家电中的灯泡类产品。
7 |
8 | 此款产品已满足用户基本功能需求,项目中用到了大部分主要SDK接口,供使用GizWifiSDK的开发者参考。主要功能如下:
9 | ▪ 初始化SDK
10 | ▪ 用户登录
11 | ▪ 设备配置入网
12 | ▪ 搜索设备列表
13 | ▪ 绑定或解绑设备
14 | ▪ 智能灯电源的开关
15 | ▪ 智能灯色彩和色温的切换
16 | ▪ 智能灯色彩和色温的连续调节
17 | ▪ 智能灯亮度调节
18 | ▪ 修改智能灯的别名
19 | ▪ 智能灯倒计时开关
20 | ▪ 智能灯定时预约。定时预约采用云端定时下发命令的形式,可以不限次数预约
21 |
22 | ## 使用说明
23 |
24 | 使用机智云开源APP之前,需要先在机智云开发平台创建您自己的产品和应用。
25 | 开源App需要使用您申请的AppId、AppSecret以及您自己的产品ProductKey才能正常运行。
26 | 具体申请流程请参见:http://docs.gizwits.com/hc/。
27 | 注意需要修改配置文件配置开发者的个人应用信息,请参考:http://docs.gizwits.com/hc/kb/article/181715/ ,第5节《配置文件说明》,按照提示进行替换。
28 | 使用QQ、微信登录或百度或极光推送功能之前,需要您先到相应网站申请对应的应用信息,在配置文件中作相应的替换。
29 |
30 | ## GizWifiSDK 版本号
31 |
32 | 2.04.04
33 |
34 | ## 硬件依赖
35 |
36 | Smart-Light 项目调试,需要有调试设备的支持,您可以使用虚拟设备或者实体设备搭建调试环境。
37 |
38 | ▪ 虚拟设备
39 | 机智云官网提供智能灯2代虚拟设备的支持。请登录机智云开发者网站,进入机智云实验室查看。开发者网站链接地址:
40 | https://site.gizwits.com/zh-cn/developer/ssl/login
41 |
42 | ## 问题反馈
43 |
44 | 您可以给机智云的技术支持人员发送邮件,反馈您在使用过程中遇到的任何问题。
45 | 邮箱:club@gizwits.com
46 |
47 | ## App效果图
48 |
49 | 
50 |
--------------------------------------------------------------------------------
/assets/UIConfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "app_id":"your_app_id",
3 | "app_secret":"your_app_secret",
4 | "product_key":["your_product_key"],
5 | "wifi_type_select":true,
6 | "tencent_app_id":"your_tencent_app_id",
7 | "wechat_app_id":"your_wechat_app_id",
8 | "wechat_app_secret":"your_wechat_app_secret",
9 | "push_type":0,
10 | "bpush_app_key":"your_bpush_app_key",
11 | "openAPI_URL":"",
12 | "site_URL":"",
13 | "push_URL":"",
14 | "buttonColor":"F8DC26",
15 | "buttonTextColor":"000000",
16 | "navigationBarColor":"F8DC26",
17 | "navigationBarTextColor":"000000",
18 | "configProgressViewColor":"000000",
19 | "addDeviceTitle":""
20 | }
--------------------------------------------------------------------------------
/effect.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gizwits/Gizwits-SmartBuld_Android/47ff43a52e8f709850a6b80f62dc8cdd8af7b610/effect.png
--------------------------------------------------------------------------------
/ic_launcher-web.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gizwits/Gizwits-SmartBuld_Android/47ff43a52e8f709850a6b80f62dc8cdd8af7b610/ic_launcher-web.png
--------------------------------------------------------------------------------
/libs/BLEasyConfig.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gizwits/Gizwits-SmartBuld_Android/47ff43a52e8f709850a6b80f62dc8cdd8af7b610/libs/BLEasyConfig.jar
--------------------------------------------------------------------------------
/libs/GizWifiSDK.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gizwits/Gizwits-SmartBuld_Android/47ff43a52e8f709850a6b80f62dc8cdd8af7b610/libs/GizWifiSDK.jar
--------------------------------------------------------------------------------
/libs/LSFSK_1.0.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gizwits/Gizwits-SmartBuld_Android/47ff43a52e8f709850a6b80f62dc8cdd8af7b610/libs/LSFSK_1.0.jar
--------------------------------------------------------------------------------
/libs/Lark7618SDK_noudp1606031910_0101.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gizwits/Gizwits-SmartBuld_Android/47ff43a52e8f709850a6b80f62dc8cdd8af7b610/libs/Lark7618SDK_noudp1606031910_0101.jar
--------------------------------------------------------------------------------
/libs/OneShotConfig.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gizwits/Gizwits-SmartBuld_Android/47ff43a52e8f709850a6b80f62dc8cdd8af7b610/libs/OneShotConfig.jar
--------------------------------------------------------------------------------
/libs/android-support-v4.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gizwits/Gizwits-SmartBuld_Android/47ff43a52e8f709850a6b80f62dc8cdd8af7b610/libs/android-support-v4.jar
--------------------------------------------------------------------------------
/libs/armeabi/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gizwits/Gizwits-SmartBuld_Android/47ff43a52e8f709850a6b80f62dc8cdd8af7b610/libs/armeabi/.DS_Store
--------------------------------------------------------------------------------
/libs/armeabi/libBLEasyConfig.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gizwits/Gizwits-SmartBuld_Android/47ff43a52e8f709850a6b80f62dc8cdd8af7b610/libs/armeabi/libBLEasyConfig.so
--------------------------------------------------------------------------------
/libs/armeabi/libSDKLog.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gizwits/Gizwits-SmartBuld_Android/47ff43a52e8f709850a6b80f62dc8cdd8af7b610/libs/armeabi/libSDKLog.so
--------------------------------------------------------------------------------
/libs/armeabi/libbdpush_V2_6.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gizwits/Gizwits-SmartBuld_Android/47ff43a52e8f709850a6b80f62dc8cdd8af7b610/libs/armeabi/libbdpush_V2_6.so
--------------------------------------------------------------------------------
/libs/armeabi/libbspatch.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gizwits/Gizwits-SmartBuld_Android/47ff43a52e8f709850a6b80f62dc8cdd8af7b610/libs/armeabi/libbspatch.so
--------------------------------------------------------------------------------
/libs/armeabi/libjpush215.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gizwits/Gizwits-SmartBuld_Android/47ff43a52e8f709850a6b80f62dc8cdd8af7b610/libs/armeabi/libjpush215.so
--------------------------------------------------------------------------------
/libs/armeabi/libsimpleconfiglib.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gizwits/Gizwits-SmartBuld_Android/47ff43a52e8f709850a6b80f62dc8cdd8af7b610/libs/armeabi/libsimpleconfiglib.so
--------------------------------------------------------------------------------
/libs/armeabi/libwavegen.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gizwits/Gizwits-SmartBuld_Android/47ff43a52e8f709850a6b80f62dc8cdd8af7b610/libs/armeabi/libwavegen.so
--------------------------------------------------------------------------------
/libs/easylink2.0.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gizwits/Gizwits-SmartBuld_Android/47ff43a52e8f709850a6b80f62dc8cdd8af7b610/libs/easylink2.0.jar
--------------------------------------------------------------------------------
/libs/hiflying-iots-android-smartlink7.0.2.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gizwits/Gizwits-SmartBuld_Android/47ff43a52e8f709850a6b80f62dc8cdd8af7b610/libs/hiflying-iots-android-smartlink7.0.2.jar
--------------------------------------------------------------------------------
/libs/jpush-android-2.1.5.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gizwits/Gizwits-SmartBuld_Android/47ff43a52e8f709850a6b80f62dc8cdd8af7b610/libs/jpush-android-2.1.5.jar
--------------------------------------------------------------------------------
/libs/libEsptouch_v0.3.3.4_3.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gizwits/Gizwits-SmartBuld_Android/47ff43a52e8f709850a6b80f62dc8cdd8af7b610/libs/libEsptouch_v0.3.3.4_3.jar
--------------------------------------------------------------------------------
/libs/libForEElink.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gizwits/Gizwits-SmartBuld_Android/47ff43a52e8f709850a6b80f62dc8cdd8af7b610/libs/libForEElink.jar
--------------------------------------------------------------------------------
/libs/libammsdk.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gizwits/Gizwits-SmartBuld_Android/47ff43a52e8f709850a6b80f62dc8cdd8af7b610/libs/libammsdk.jar
--------------------------------------------------------------------------------
/libs/mta-sdk-1.6.2.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gizwits/Gizwits-SmartBuld_Android/47ff43a52e8f709850a6b80f62dc8cdd8af7b610/libs/mta-sdk-1.6.2.jar
--------------------------------------------------------------------------------
/libs/open_sdk_r5756.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gizwits/Gizwits-SmartBuld_Android/47ff43a52e8f709850a6b80f62dc8cdd8af7b610/libs/open_sdk_r5756.jar
--------------------------------------------------------------------------------
/libs/pushservice-5.0.0.66.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gizwits/Gizwits-SmartBuld_Android/47ff43a52e8f709850a6b80f62dc8cdd8af7b610/libs/pushservice-5.0.0.66.jar
--------------------------------------------------------------------------------
/libs/simpleconfigwizardlib.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gizwits/Gizwits-SmartBuld_Android/47ff43a52e8f709850a6b80f62dc8cdd8af7b610/libs/simpleconfigwizardlib.jar
--------------------------------------------------------------------------------
/libs/volley-1.0.19.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gizwits/Gizwits-SmartBuld_Android/47ff43a52e8f709850a6b80f62dc8cdd8af7b610/libs/volley-1.0.19.jar
--------------------------------------------------------------------------------
/libs/xUtils-2.6.14.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gizwits/Gizwits-SmartBuld_Android/47ff43a52e8f709850a6b80f62dc8cdd8af7b610/libs/xUtils-2.6.14.jar
--------------------------------------------------------------------------------
/libs/zxing.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gizwits/Gizwits-SmartBuld_Android/47ff43a52e8f709850a6b80f62dc8cdd8af7b610/libs/zxing.jar
--------------------------------------------------------------------------------
/proguard-project.txt:
--------------------------------------------------------------------------------
1 | # To enable ProGuard in your project, edit project.properties
2 | # to define the proguard.config property as described in that file.
3 | #
4 | # Add project specific ProGuard rules here.
5 | # By default, the flags in this file are appended to flags specified
6 | # in ${sdk.dir}/tools/proguard/proguard-android.txt
7 | # You can edit the include path and order by changing the ProGuard
8 | # include property in project.properties.
9 | #
10 | # For more details, see
11 | # http://developer.android.com/guide/developing/tools/proguard.html
12 |
13 | # Add any project specific keep options here:
14 |
15 | # If your project uses WebView with JS, uncomment the following
16 | # and specify the fully qualified class name to the JavaScript interface
17 | # class:
18 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
19 | # public *;
20 | #}
21 |
--------------------------------------------------------------------------------
/project.properties:
--------------------------------------------------------------------------------
1 | # This file is automatically generated by Android Tools.
2 | # Do not modify this file -- YOUR CHANGES WILL BE ERASED!
3 | #
4 | # This file must be checked in Version Control Systems.
5 | #
6 | # To customize properties used by the Ant build system edit
7 | # "ant.properties", and override values to adapt the script to your
8 | # project structure.
9 | #
10 | # To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
11 | #proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
12 |
13 | # Project target.
14 | target=android-19
15 |
--------------------------------------------------------------------------------
/res/drawable-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gizwits/Gizwits-SmartBuld_Android/47ff43a52e8f709850a6b80f62dc8cdd8af7b610/res/drawable-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/res/drawable-hdpi/ic_richpush_actionbar_back.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gizwits/Gizwits-SmartBuld_Android/47ff43a52e8f709850a6b80f62dc8cdd8af7b610/res/drawable-hdpi/ic_richpush_actionbar_back.png
--------------------------------------------------------------------------------
/res/drawable-hdpi/ic_richpush_actionbar_divider.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gizwits/Gizwits-SmartBuld_Android/47ff43a52e8f709850a6b80f62dc8cdd8af7b610/res/drawable-hdpi/ic_richpush_actionbar_divider.png
--------------------------------------------------------------------------------
/res/drawable-hdpi/open_perecent_bg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gizwits/Gizwits-SmartBuld_Android/47ff43a52e8f709850a6b80f62dc8cdd8af7b610/res/drawable-hdpi/open_perecent_bg.png
--------------------------------------------------------------------------------
/res/drawable-hdpi/richpush_btn_selector.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
9 |
10 |
14 |
15 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/res/drawable-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gizwits/Gizwits-SmartBuld_Android/47ff43a52e8f709850a6b80f62dc8cdd8af7b610/res/drawable-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/res/drawable-xhdpi/about_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gizwits/Gizwits-SmartBuld_Android/47ff43a52e8f709850a6b80f62dc8cdd8af7b610/res/drawable-xhdpi/about_icon.png
--------------------------------------------------------------------------------
/res/drawable-xhdpi/add.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gizwits/Gizwits-SmartBuld_Android/47ff43a52e8f709850a6b80f62dc8cdd8af7b610/res/drawable-xhdpi/add.png
--------------------------------------------------------------------------------
/res/drawable-xhdpi/arrow.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gizwits/Gizwits-SmartBuld_Android/47ff43a52e8f709850a6b80f62dc8cdd8af7b610/res/drawable-xhdpi/arrow.png
--------------------------------------------------------------------------------
/res/drawable-xhdpi/back_bt.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gizwits/Gizwits-SmartBuld_Android/47ff43a52e8f709850a6b80f62dc8cdd8af7b610/res/drawable-xhdpi/back_bt.png
--------------------------------------------------------------------------------
/res/drawable-xhdpi/back_bt_.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gizwits/Gizwits-SmartBuld_Android/47ff43a52e8f709850a6b80f62dc8cdd8af7b610/res/drawable-xhdpi/back_bt_.png
--------------------------------------------------------------------------------
/res/drawable-xhdpi/barcode_frame.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gizwits/Gizwits-SmartBuld_Android/47ff43a52e8f709850a6b80f62dc8cdd8af7b610/res/drawable-xhdpi/barcode_frame.png
--------------------------------------------------------------------------------
/res/drawable-xhdpi/barcode_laser_line.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gizwits/Gizwits-SmartBuld_Android/47ff43a52e8f709850a6b80f62dc8cdd8af7b610/res/drawable-xhdpi/barcode_laser_line.png
--------------------------------------------------------------------------------
/res/drawable-xhdpi/button_back.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gizwits/Gizwits-SmartBuld_Android/47ff43a52e8f709850a6b80f62dc8cdd8af7b610/res/drawable-xhdpi/button_back.png
--------------------------------------------------------------------------------
/res/drawable-xhdpi/button_blue_long.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gizwits/Gizwits-SmartBuld_Android/47ff43a52e8f709850a6b80f62dc8cdd8af7b610/res/drawable-xhdpi/button_blue_long.png
--------------------------------------------------------------------------------
/res/drawable-xhdpi/button_invisible.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gizwits/Gizwits-SmartBuld_Android/47ff43a52e8f709850a6b80f62dc8cdd8af7b610/res/drawable-xhdpi/button_invisible.png
--------------------------------------------------------------------------------
/res/drawable-xhdpi/button_more.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gizwits/Gizwits-SmartBuld_Android/47ff43a52e8f709850a6b80f62dc8cdd8af7b610/res/drawable-xhdpi/button_more.png
--------------------------------------------------------------------------------
/res/drawable-xhdpi/button_not_sure.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gizwits/Gizwits-SmartBuld_Android/47ff43a52e8f709850a6b80f62dc8cdd8af7b610/res/drawable-xhdpi/button_not_sure.png
--------------------------------------------------------------------------------
/res/drawable-xhdpi/button_refresh.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gizwits/Gizwits-SmartBuld_Android/47ff43a52e8f709850a6b80f62dc8cdd8af7b610/res/drawable-xhdpi/button_refresh.png
--------------------------------------------------------------------------------
/res/drawable-xhdpi/button_setting.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gizwits/Gizwits-SmartBuld_Android/47ff43a52e8f709850a6b80f62dc8cdd8af7b610/res/drawable-xhdpi/button_setting.png
--------------------------------------------------------------------------------
/res/drawable-xhdpi/button_sure.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gizwits/Gizwits-SmartBuld_Android/47ff43a52e8f709850a6b80f62dc8cdd8af7b610/res/drawable-xhdpi/button_sure.png
--------------------------------------------------------------------------------
/res/drawable-xhdpi/button_visible.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gizwits/Gizwits-SmartBuld_Android/47ff43a52e8f709850a6b80f62dc8cdd8af7b610/res/drawable-xhdpi/button_visible.png
--------------------------------------------------------------------------------
/res/drawable-xhdpi/checkmark.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gizwits/Gizwits-SmartBuld_Android/47ff43a52e8f709850a6b80f62dc8cdd8af7b610/res/drawable-xhdpi/checkmark.png
--------------------------------------------------------------------------------
/res/drawable-xhdpi/comd1_btn_menu.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gizwits/Gizwits-SmartBuld_Android/47ff43a52e8f709850a6b80f62dc8cdd8af7b610/res/drawable-xhdpi/comd1_btn_menu.png
--------------------------------------------------------------------------------
/res/drawable-xhdpi/comd1_home_bnt_off.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gizwits/Gizwits-SmartBuld_Android/47ff43a52e8f709850a6b80f62dc8cdd8af7b610/res/drawable-xhdpi/comd1_home_bnt_off.png
--------------------------------------------------------------------------------
/res/drawable-xhdpi/comd1_home_bnt_on.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gizwits/Gizwits-SmartBuld_Android/47ff43a52e8f709850a6b80f62dc8cdd8af7b610/res/drawable-xhdpi/comd1_home_bnt_on.png
--------------------------------------------------------------------------------
/res/drawable-xhdpi/comd1_home_btn_color.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gizwits/Gizwits-SmartBuld_Android/47ff43a52e8f709850a6b80f62dc8cdd8af7b610/res/drawable-xhdpi/comd1_home_btn_color.png
--------------------------------------------------------------------------------
/res/drawable-xhdpi/comd1_home_btn_color_temperature.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gizwits/Gizwits-SmartBuld_Android/47ff43a52e8f709850a6b80f62dc8cdd8af7b610/res/drawable-xhdpi/comd1_home_btn_color_temperature.png
--------------------------------------------------------------------------------
/res/drawable-xhdpi/comd1_home_icon_brightness.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gizwits/Gizwits-SmartBuld_Android/47ff43a52e8f709850a6b80f62dc8cdd8af7b610/res/drawable-xhdpi/comd1_home_icon_brightness.png
--------------------------------------------------------------------------------
/res/drawable-xhdpi/comd1_home_icon_light.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gizwits/Gizwits-SmartBuld_Android/47ff43a52e8f709850a6b80f62dc8cdd8af7b610/res/drawable-xhdpi/comd1_home_icon_light.png
--------------------------------------------------------------------------------
/res/drawable-xhdpi/comd1_home_icon_tab.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gizwits/Gizwits-SmartBuld_Android/47ff43a52e8f709850a6b80f62dc8cdd8af7b610/res/drawable-xhdpi/comd1_home_icon_tab.png
--------------------------------------------------------------------------------
/res/drawable-xhdpi/comd1_icon_return.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gizwits/Gizwits-SmartBuld_Android/47ff43a52e8f709850a6b80f62dc8cdd8af7b610/res/drawable-xhdpi/comd1_icon_return.png
--------------------------------------------------------------------------------
/res/drawable-xhdpi/comd1_light_sewen_bg2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gizwits/Gizwits-SmartBuld_Android/47ff43a52e8f709850a6b80f62dc8cdd8af7b610/res/drawable-xhdpi/comd1_light_sewen_bg2.png
--------------------------------------------------------------------------------
/res/drawable-xhdpi/comd1_more_icon_name.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gizwits/Gizwits-SmartBuld_Android/47ff43a52e8f709850a6b80f62dc8cdd8af7b610/res/drawable-xhdpi/comd1_more_icon_name.png
--------------------------------------------------------------------------------
/res/drawable-xhdpi/comd1_more_icon_schedule.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gizwits/Gizwits-SmartBuld_Android/47ff43a52e8f709850a6b80f62dc8cdd8af7b610/res/drawable-xhdpi/comd1_more_icon_schedule.png
--------------------------------------------------------------------------------
/res/drawable-xhdpi/comd1_more_icon_timer.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gizwits/Gizwits-SmartBuld_Android/47ff43a52e8f709850a6b80f62dc8cdd8af7b610/res/drawable-xhdpi/comd1_more_icon_timer.png
--------------------------------------------------------------------------------
/res/drawable-xhdpi/comd_arrow_right_gray.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gizwits/Gizwits-SmartBuld_Android/47ff43a52e8f709850a6b80f62dc8cdd8af7b610/res/drawable-xhdpi/comd_arrow_right_gray.png
--------------------------------------------------------------------------------
/res/drawable-xhdpi/comd_home_icon_timer.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gizwits/Gizwits-SmartBuld_Android/47ff43a52e8f709850a6b80f62dc8cdd8af7b610/res/drawable-xhdpi/comd_home_icon_timer.png
--------------------------------------------------------------------------------
/res/drawable-xhdpi/comd_ic_clear.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gizwits/Gizwits-SmartBuld_Android/47ff43a52e8f709850a6b80f62dc8cdd8af7b610/res/drawable-xhdpi/comd_ic_clear.png
--------------------------------------------------------------------------------
/res/drawable-xhdpi/comd_icon_return.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gizwits/Gizwits-SmartBuld_Android/47ff43a52e8f709850a6b80f62dc8cdd8af7b610/res/drawable-xhdpi/comd_icon_return.png
--------------------------------------------------------------------------------
/res/drawable-xhdpi/comd_more_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gizwits/Gizwits-SmartBuld_Android/47ff43a52e8f709850a6b80f62dc8cdd8af7b610/res/drawable-xhdpi/comd_more_icon.png
--------------------------------------------------------------------------------
/res/drawable-xhdpi/comd_more_icon_name.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gizwits/Gizwits-SmartBuld_Android/47ff43a52e8f709850a6b80f62dc8cdd8af7b610/res/drawable-xhdpi/comd_more_icon_name.png
--------------------------------------------------------------------------------
/res/drawable-xhdpi/comd_more_icon_schedule.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gizwits/Gizwits-SmartBuld_Android/47ff43a52e8f709850a6b80f62dc8cdd8af7b610/res/drawable-xhdpi/comd_more_icon_schedule.png
--------------------------------------------------------------------------------
/res/drawable-xhdpi/comd_more_icon_timer.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gizwits/Gizwits-SmartBuld_Android/47ff43a52e8f709850a6b80f62dc8cdd8af7b610/res/drawable-xhdpi/comd_more_icon_timer.png
--------------------------------------------------------------------------------
/res/drawable-xhdpi/comd_power_off.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gizwits/Gizwits-SmartBuld_Android/47ff43a52e8f709850a6b80f62dc8cdd8af7b610/res/drawable-xhdpi/comd_power_off.png
--------------------------------------------------------------------------------
/res/drawable-xhdpi/comd_power_on.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gizwits/Gizwits-SmartBuld_Android/47ff43a52e8f709850a6b80f62dc8cdd8af7b610/res/drawable-xhdpi/comd_power_on.png
--------------------------------------------------------------------------------
/res/drawable-xhdpi/comd_reservation_button.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gizwits/Gizwits-SmartBuld_Android/47ff43a52e8f709850a6b80f62dc8cdd8af7b610/res/drawable-xhdpi/comd_reservation_button.png
--------------------------------------------------------------------------------
/res/drawable-xhdpi/comd_timer_btn_add.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gizwits/Gizwits-SmartBuld_Android/47ff43a52e8f709850a6b80f62dc8cdd8af7b610/res/drawable-xhdpi/comd_timer_btn_add.png
--------------------------------------------------------------------------------
/res/drawable-xhdpi/comd_tips_box.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gizwits/Gizwits-SmartBuld_Android/47ff43a52e8f709850a6b80f62dc8cdd8af7b610/res/drawable-xhdpi/comd_tips_box.png
--------------------------------------------------------------------------------
/res/drawable-xhdpi/comd_top.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gizwits/Gizwits-SmartBuld_Android/47ff43a52e8f709850a6b80f62dc8cdd8af7b610/res/drawable-xhdpi/comd_top.png
--------------------------------------------------------------------------------
/res/drawable-xhdpi/device_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gizwits/Gizwits-SmartBuld_Android/47ff43a52e8f709850a6b80f62dc8cdd8af7b610/res/drawable-xhdpi/device_icon.png
--------------------------------------------------------------------------------
/res/drawable-xhdpi/failsoft.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gizwits/Gizwits-SmartBuld_Android/47ff43a52e8f709850a6b80f62dc8cdd8af7b610/res/drawable-xhdpi/failsoft.png
--------------------------------------------------------------------------------
/res/drawable-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gizwits/Gizwits-SmartBuld_Android/47ff43a52e8f709850a6b80f62dc8cdd8af7b610/res/drawable-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/res/drawable-xhdpi/login_password.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gizwits/Gizwits-SmartBuld_Android/47ff43a52e8f709850a6b80f62dc8cdd8af7b610/res/drawable-xhdpi/login_password.png
--------------------------------------------------------------------------------
/res/drawable-xhdpi/logo3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gizwits/Gizwits-SmartBuld_Android/47ff43a52e8f709850a6b80f62dc8cdd8af7b610/res/drawable-xhdpi/logo3.png
--------------------------------------------------------------------------------
/res/drawable-xhdpi/mymyshoft.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gizwits/Gizwits-SmartBuld_Android/47ff43a52e8f709850a6b80f62dc8cdd8af7b610/res/drawable-xhdpi/mymyshoft.png
--------------------------------------------------------------------------------
/res/drawable-xhdpi/nodevice.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gizwits/Gizwits-SmartBuld_Android/47ff43a52e8f709850a6b80f62dc8cdd8af7b610/res/drawable-xhdpi/nodevice.png
--------------------------------------------------------------------------------
/res/drawable-xhdpi/noselect.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gizwits/Gizwits-SmartBuld_Android/47ff43a52e8f709850a6b80f62dc8cdd8af7b610/res/drawable-xhdpi/noselect.png
--------------------------------------------------------------------------------
/res/drawable-xhdpi/phone.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gizwits/Gizwits-SmartBuld_Android/47ff43a52e8f709850a6b80f62dc8cdd8af7b610/res/drawable-xhdpi/phone.png
--------------------------------------------------------------------------------
/res/drawable-xhdpi/qq.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gizwits/Gizwits-SmartBuld_Android/47ff43a52e8f709850a6b80f62dc8cdd8af7b610/res/drawable-xhdpi/qq.png
--------------------------------------------------------------------------------
/res/drawable-xhdpi/right_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gizwits/Gizwits-SmartBuld_Android/47ff43a52e8f709850a6b80f62dc8cdd8af7b610/res/drawable-xhdpi/right_icon.png
--------------------------------------------------------------------------------
/res/drawable-xhdpi/select.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gizwits/Gizwits-SmartBuld_Android/47ff43a52e8f709850a6b80f62dc8cdd8af7b610/res/drawable-xhdpi/select.png
--------------------------------------------------------------------------------
/res/drawable-xhdpi/sms.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gizwits/Gizwits-SmartBuld_Android/47ff43a52e8f709850a6b80f62dc8cdd8af7b610/res/drawable-xhdpi/sms.png
--------------------------------------------------------------------------------
/res/drawable-xhdpi/splash.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gizwits/Gizwits-SmartBuld_Android/47ff43a52e8f709850a6b80f62dc8cdd8af7b610/res/drawable-xhdpi/splash.png
--------------------------------------------------------------------------------
/res/drawable-xhdpi/splash_light.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gizwits/Gizwits-SmartBuld_Android/47ff43a52e8f709850a6b80f62dc8cdd8af7b610/res/drawable-xhdpi/splash_light.png
--------------------------------------------------------------------------------
/res/drawable-xhdpi/sub.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gizwits/Gizwits-SmartBuld_Android/47ff43a52e8f709850a6b80f62dc8cdd8af7b610/res/drawable-xhdpi/sub.png
--------------------------------------------------------------------------------
/res/drawable-xhdpi/test_comd1_light_sewen_bg2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gizwits/Gizwits-SmartBuld_Android/47ff43a52e8f709850a6b80f62dc8cdd8af7b610/res/drawable-xhdpi/test_comd1_light_sewen_bg2.png
--------------------------------------------------------------------------------
/res/drawable-xhdpi/wechat.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gizwits/Gizwits-SmartBuld_Android/47ff43a52e8f709850a6b80f62dc8cdd8af7b610/res/drawable-xhdpi/wechat.png
--------------------------------------------------------------------------------
/res/drawable-xhdpi/wifi_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gizwits/Gizwits-SmartBuld_Android/47ff43a52e8f709850a6b80f62dc8cdd8af7b610/res/drawable-xhdpi/wifi_icon.png
--------------------------------------------------------------------------------
/res/drawable-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gizwits/Gizwits-SmartBuld_Android/47ff43a52e8f709850a6b80f62dc8cdd8af7b610/res/drawable-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/res/drawable/airlink.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gizwits/Gizwits-SmartBuld_Android/47ff43a52e8f709850a6b80f62dc8cdd8af7b610/res/drawable/airlink.gif
--------------------------------------------------------------------------------
/res/drawable/alert_bottom_left_shape.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/res/drawable/alert_bottom_right_shape.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/res/drawable/alert_top_shape.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/res/drawable/border_layer_list.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | -
5 |
8 |
9 |
10 |
15 |
16 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/res/drawable/btn_getcode_shape.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/res/drawable/btn_getcode_shape_gray.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/res/drawable/button_shape_gray.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/res/drawable/checkbox_hook_selector.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/res/drawable/checkbox_laws_selector.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/res/drawable/comd_btn_remove_device.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/res/drawable/comd_selector_power.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/res/drawable/comd_switch_off2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gizwits/Gizwits-SmartBuld_Android/47ff43a52e8f709850a6b80f62dc8cdd8af7b610/res/drawable/comd_switch_off2.png
--------------------------------------------------------------------------------
/res/drawable/comd_switch_on2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gizwits/Gizwits-SmartBuld_Android/47ff43a52e8f709850a6b80f62dc8cdd8af7b610/res/drawable/comd_switch_on2.png
--------------------------------------------------------------------------------
/res/drawable/comd_toggle_selector2.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/res/drawable/devicelist_item_selector.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/res/drawable/resetsoftap.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gizwits/Gizwits-SmartBuld_Android/47ff43a52e8f709850a6b80f62dc8cdd8af7b610/res/drawable/resetsoftap.gif
--------------------------------------------------------------------------------
/res/drawable/round_rect.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/res/drawable/seek_bar.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gizwits/Gizwits-SmartBuld_Android/47ff43a52e8f709850a6b80f62dc8cdd8af7b610/res/drawable/seek_bar.png
--------------------------------------------------------------------------------
/res/drawable/seek_bar1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gizwits/Gizwits-SmartBuld_Android/47ff43a52e8f709850a6b80f62dc8cdd8af7b610/res/drawable/seek_bar1.png
--------------------------------------------------------------------------------
/res/drawable/selector_mode.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/res/drawable/selector_power.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/res/layout/activity_comd_edit_device_alias.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 |
10 |
14 |
15 |
24 |
25 |
32 |
33 |
43 |
44 |
45 |
46 |
55 |
56 |
62 |
63 |
72 |
73 |
74 |
75 |
76 |
82 |
83 |
84 |
90 |
91 |
--------------------------------------------------------------------------------
/res/layout/activity_comd_schedule_edit_action.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 |
10 |
14 |
15 |
26 |
27 |
34 |
35 |
36 |
37 |
45 |
46 |
47 |
--------------------------------------------------------------------------------
/res/layout/activity_comd_schedule_edit_device_delay.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 |
10 |
14 |
15 |
26 |
27 |
34 |
35 |
45 |
46 |
47 |
48 |
55 |
56 |
61 |
62 |
67 |
68 |
76 |
77 |
83 |
84 |
90 |
91 |
92 |
--------------------------------------------------------------------------------
/res/layout/activity_comd_schedule_edit_repeat.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 |
10 |
14 |
15 |
26 |
27 |
34 |
35 |
45 |
46 |
47 |
48 |
56 |
57 |
58 |
--------------------------------------------------------------------------------
/res/layout/activity_comd_schedule_list.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 |
10 |
14 |
15 |
24 |
25 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
46 |
47 |
51 |
52 |
59 |
60 |
67 |
68 |
69 |
70 |
71 |
72 |
80 |
81 |
90 |
91 |
92 |
99 |
100 |
108 |
109 |
--------------------------------------------------------------------------------
/res/layout/activity_gos_about.xml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
16 |
17 |
24 |
25 |
30 |
31 |
37 |
38 |
44 |
45 |
46 |
47 |
52 |
53 |
59 |
60 |
65 |
66 |
67 |
68 |
--------------------------------------------------------------------------------
/res/layout/activity_gos_airlink_config_countdown.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
14 |
15 |
21 |
22 |
23 |
30 |
31 |
--------------------------------------------------------------------------------
/res/layout/activity_gos_check_device_workwifi.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
15 |
16 |
23 |
24 |
31 |
32 |
44 |
45 |
56 |
57 |
58 |
64 |
65 |
72 |
73 |
87 |
88 |
97 |
98 |
99 |
106 |
107 |
--------------------------------------------------------------------------------
/res/layout/activity_gos_choose_device.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
17 |
18 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/res/layout/activity_gos_colorlist.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/res/layout/activity_gos_config_countdown.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
14 |
15 |
21 |
22 |
23 |
29 |
30 |
35 |
36 |
--------------------------------------------------------------------------------
/res/layout/activity_gos_config_failed.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
13 |
14 |
20 |
21 |
27 |
28 |
33 |
34 |
39 |
40 |
45 |
46 |
50 |
51 |
60 |
61 |
62 |
--------------------------------------------------------------------------------
/res/layout/activity_gos_device_control.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
12 |
13 |
19 |
20 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/res/layout/activity_gos_device_list.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
13 |
14 |
20 |
21 |
34 |
35 |
36 |
41 |
42 |
46 |
47 |
52 |
53 |
58 |
59 |
64 |
65 |
66 |
67 |
--------------------------------------------------------------------------------
/res/layout/activity_gos_device_ready.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
16 |
17 |
26 |
27 |
34 |
35 |
41 |
42 |
49 |
50 |
51 |
59 |
60 |
68 |
69 |
--------------------------------------------------------------------------------
/res/layout/activity_gos_modelist.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/res/layout/activity_gos_settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
16 |
17 |
26 |
27 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/res/layout/actvity_gos_airlink_ready.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
16 |
17 |
24 |
25 |
31 |
32 |
39 |
40 |
41 |
49 |
50 |
60 |
61 |
--------------------------------------------------------------------------------
/res/layout/actvity_gos_device_reset.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
16 |
17 |
24 |
25 |
31 |
32 |
39 |
40 |
41 |
48 |
49 |
59 |
60 |
--------------------------------------------------------------------------------
/res/layout/alert_gos_empty.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
15 |
16 |
25 |
26 |
27 |
34 |
35 |
42 |
43 |
44 |
49 |
50 |
51 |
55 |
56 |
64 |
65 |
71 |
72 |
73 |
78 |
79 |
80 |
88 |
89 |
95 |
96 |
97 |
98 |
--------------------------------------------------------------------------------
/res/layout/alert_gos_logout.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
15 |
16 |
25 |
26 |
27 |
34 |
35 |
42 |
43 |
44 |
49 |
50 |
51 |
55 |
56 |
64 |
65 |
71 |
72 |
73 |
78 |
79 |
80 |
88 |
89 |
95 |
96 |
97 |
98 |
--------------------------------------------------------------------------------
/res/layout/alert_gos_new_device.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
16 |
17 |
26 |
27 |
31 |
32 |
38 |
39 |
45 |
46 |
52 |
53 |
59 |
60 |
68 |
69 |
70 |
--------------------------------------------------------------------------------
/res/layout/alert_gos_quit.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
15 |
16 |
25 |
26 |
27 |
34 |
35 |
42 |
43 |
44 |
49 |
50 |
51 |
55 |
56 |
64 |
65 |
71 |
72 |
73 |
78 |
79 |
80 |
88 |
89 |
95 |
96 |
97 |
98 |
--------------------------------------------------------------------------------
/res/layout/alert_gos_wifi_list.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
16 |
17 |
21 |
22 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/res/layout/dialog_comd_unbind_device.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
17 |
18 |
23 |
24 |
32 |
33 |
41 |
42 |
43 |
--------------------------------------------------------------------------------
/res/layout/item_comd_listview_with_checkbox.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
15 |
16 |
24 |
25 |
--------------------------------------------------------------------------------
/res/layout/item_comd_schedule_list.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
15 |
16 |
20 |
21 |
28 |
29 |
37 |
38 |
39 |
46 |
47 |
48 |
56 |
57 |
63 |
64 |
72 |
73 |
74 |
--------------------------------------------------------------------------------
/res/layout/item_gos_mode_list.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
13 |
14 |
23 |
24 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/res/layout/item_gos_wifi_list.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
13 |
14 |
23 |
24 |
30 |
31 |
32 |
--------------------------------------------------------------------------------
/res/layout/jpush_popwin_layout.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
14 |
15 |
--------------------------------------------------------------------------------
/res/layout/jpush_webview_layout.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
13 |
14 |
22 |
23 |
31 |
32 |
43 |
44 |
45 |
50 |
51 |
--------------------------------------------------------------------------------
/res/layout/view_gos_notification.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
10 |
11 |
19 |
20 |
25 |
31 |
32 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
--------------------------------------------------------------------------------
/res/layout/view_gos_title_listview.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
19 |
20 |
29 |
30 |
37 |
38 |
39 |
49 |
50 |
51 |
--------------------------------------------------------------------------------
/res/menu/devicelist_login.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/res/menu/devicelist_logout.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/res/values-en/arrays_mode.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | - MXCHIP
6 | - HF
7 | - RTK
8 | - WM
9 | - ESP
10 | - QCT
11 | - TI
12 | - FSK
13 | - MXCHIP3
14 | - BL
15 |
16 |
17 |
--------------------------------------------------------------------------------
/res/values-v11/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/res/values-v14/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
8 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/res/values-w820dp/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
8 | 64dp
9 |
10 |
11 |
--------------------------------------------------------------------------------
/res/values/arrays_mode.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | - 庆科
6 | - 汉枫
7 | - 瑞昱
8 | - 联盛德
9 | - 乐鑫
10 | - 高通
11 | - TI
12 | - 宇音天下
13 | - 庆科V3
14 | - 古北
15 |
16 |
17 |
--------------------------------------------------------------------------------
/res/values/attrs.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 |
--------------------------------------------------------------------------------
/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | #fff
5 | #000
6 | #808080
7 | #F8DC26
8 | #E8E8E8
9 | #298eee
10 | #d0d0d0
11 | #88000000
12 | #FF6347
13 | #FFFAF0
14 | #000000
15 | #919191
16 | #c7c7c7
17 | #0b5c93
18 | #2db4e3
19 | #f5f5f5
20 |
21 |
22 |
23 | #00000000
24 | #297dee
25 | #ededed
26 | #ff6100
27 | #999999
28 | #333333
29 | #e4e40c
30 | #a5b1b6
31 | #efefef
32 | #51a0fc
33 |
34 |
--------------------------------------------------------------------------------
/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 16dp
5 | 16dp
6 | 70dip
7 | 40dip
8 |
9 |
10 |
--------------------------------------------------------------------------------
/res/values/ids.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
--------------------------------------------------------------------------------
/res/values/jpush_style.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
13 |
--------------------------------------------------------------------------------
/src/com/gizwits/opensource/appkit/ConfigModule/GosAirlinkReadyActivity.java:
--------------------------------------------------------------------------------
1 | package com.gizwits.opensource.appkit.ConfigModule;
2 |
3 | import com.gizwits.opensource.appkit.CommonModule.GosDeploy;
4 | import com.gizwits.opensource.appkit.view.GifView;
5 | import com.gizwits.opensource.smartlight.R;
6 |
7 | import android.content.Intent;
8 | import android.os.Bundle;
9 | import android.view.KeyEvent;
10 | import android.view.MenuItem;
11 | import android.view.View;
12 | import android.view.View.OnClickListener;
13 | import android.widget.Button;
14 | import android.widget.CheckBox;
15 | import android.widget.CompoundButton;
16 | import android.widget.TextView;
17 | import android.widget.CompoundButton.OnCheckedChangeListener;
18 |
19 | public class GosAirlinkReadyActivity extends GosConfigModuleBaseActivity implements OnClickListener {
20 |
21 | /** The cb Select */
22 | CheckBox cbSelect;
23 |
24 | /** The tv Select */
25 | TextView tvSelect;
26 |
27 | /** The btn Next */
28 | Button btnNext;
29 |
30 | @Override
31 | protected void onCreate(Bundle savedInstanceState) {
32 | super.onCreate(savedInstanceState);
33 | setContentView(R.layout.actvity_gos_airlink_ready);
34 | // 设置ActionBar
35 | setActionBar(true, true, R.string.airlink_ready_title);
36 |
37 | initView();
38 | initEvent();
39 | }
40 |
41 | private void initView() {
42 | cbSelect = (CheckBox) findViewById(R.id.cbSelect);
43 | tvSelect = (TextView) findViewById(R.id.tvSelect);
44 | btnNext = (Button) findViewById(R.id.btnNext);
45 |
46 | /** 加载Gif */
47 | GifView gif = (GifView) findViewById(R.id.softreset);
48 | gif.setMovieResource(R.drawable.airlink);
49 |
50 | // 配置文件部署
51 | btnNext.setBackgroundDrawable(GosDeploy.setButtonBackgroundColor());
52 | btnNext.setTextColor(GosDeploy.setButtonTextColor());
53 |
54 | }
55 |
56 | private void initEvent() {
57 | btnNext.setOnClickListener(this);
58 | tvSelect.setOnClickListener(this);
59 | btnNext.setClickable(false);
60 | btnNext.setBackgroundResource(R.drawable.button_shape_gray);
61 |
62 | cbSelect.setOnCheckedChangeListener(new OnCheckedChangeListener() {
63 |
64 | @Override
65 | public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
66 | if (isChecked) {
67 | btnNext.setBackgroundDrawable(GosDeploy.setButtonBackgroundColor());
68 | btnNext.setClickable(true);
69 | } else {
70 | btnNext.setBackgroundResource(R.drawable.button_shape_gray);
71 | btnNext.setClickable(false);
72 | }
73 |
74 | }
75 | });
76 | }
77 |
78 | @Override
79 | public void onClick(View v) {
80 | switch (v.getId()) {
81 | case R.id.btnNext:
82 | Intent intent = new Intent(this, GosAirlinkConfigCountdownActivity.class);
83 | startActivity(intent);
84 | finish();
85 | break;
86 |
87 | case R.id.tvSelect:
88 | if (cbSelect.isChecked()) {
89 | cbSelect.setChecked(false);
90 | } else {
91 | cbSelect.setChecked(true);
92 | }
93 | break;
94 |
95 | default:
96 | break;
97 | }
98 | }
99 |
100 | @Override
101 | public boolean onOptionsItemSelected(MenuItem item) {
102 | switch (item.getItemId()) {
103 | case android.R.id.home:
104 | Intent intent = new Intent(this, GosAirlinkChooseDeviceWorkWiFiActivity.class);
105 | startActivity(intent);
106 | overridePendingTransition(android.R.anim.slide_in_left, android.R.anim.slide_out_right);
107 | this.finish();
108 | break;
109 | }
110 | return true;
111 | }
112 |
113 | @Override
114 | public boolean onKeyDown(int keyCode, KeyEvent event) {
115 | Intent intent = new Intent(this, GosAirlinkChooseDeviceWorkWiFiActivity.class);
116 | startActivity(intent);
117 | overridePendingTransition(android.R.anim.slide_in_left, android.R.anim.slide_out_right);
118 | this.finish();
119 | return true;
120 | }
121 |
122 | }
123 |
--------------------------------------------------------------------------------
/src/com/gizwits/opensource/appkit/ConfigModule/GosConfigFailedActivity.java:
--------------------------------------------------------------------------------
1 | package com.gizwits.opensource.appkit.ConfigModule;
2 |
3 | import com.gizwits.opensource.appkit.CommonModule.GosDeploy;
4 | import com.gizwits.opensource.smartlight.R;
5 |
6 | import android.content.Intent;
7 | import android.os.Bundle;
8 | import android.view.KeyEvent;
9 | import android.view.MenuItem;
10 | import android.view.View;
11 | import android.view.View.OnClickListener;
12 | import android.widget.Button;
13 |
14 | public class GosConfigFailedActivity extends GosConfigModuleBaseActivity implements OnClickListener {
15 |
16 | /** The btn Again */
17 | Button btnAgain;
18 |
19 | /** The soft SSID */
20 | String softSSID;
21 |
22 | /** The data */
23 | String promptText, cancelBesureText, beSureText, cancelText;
24 |
25 | @Override
26 | protected void onCreate(Bundle savedInstanceState) {
27 | super.onCreate(savedInstanceState);
28 | setContentView(R.layout.activity_gos_config_failed);
29 | // 设置ActionBar
30 | setActionBar(true, true, R.string.join_failed_title);
31 |
32 | initView();
33 | initEvent();
34 | initData();
35 | }
36 |
37 | private void initView() {
38 | btnAgain = (Button) findViewById(R.id.btnAgain);
39 |
40 | // 配置文件部署
41 | btnAgain.setBackgroundDrawable(GosDeploy.setButtonBackgroundColor());
42 | btnAgain.setTextColor(GosDeploy.setButtonTextColor());
43 | }
44 |
45 | private void initEvent() {
46 | btnAgain.setOnClickListener(this);
47 | }
48 |
49 | private void initData() {
50 | promptText = (String) getText(R.string.prompt);
51 | cancelBesureText = (String) getText(R.string.cancel_besure);
52 | beSureText = (String) getText(R.string.besure);
53 | cancelText = (String) getText(R.string.no);
54 | }
55 |
56 | // 屏蔽掉返回键
57 | @Override
58 | public boolean onKeyDown(int keyCode, KeyEvent event) {
59 | if (keyCode == KeyEvent.KEYCODE_BACK) {
60 | quitAlert(this);
61 | return true;
62 | }
63 | return false;
64 | }
65 |
66 | @Override
67 | public boolean onOptionsItemSelected(MenuItem menu) {
68 | switch (menu.getItemId()) {
69 | case android.R.id.home:
70 | quitAlert(this);
71 | break;
72 |
73 | default:
74 | break;
75 | }
76 |
77 | return true;
78 | }
79 |
80 | @Override
81 | public void onClick(View v) {
82 | switch (v.getId()) {
83 | case R.id.btnAgain:
84 | Intent intent = new Intent(this, GosCheckDeviceWorkWiFiActivity.class);
85 | startActivity(intent);
86 | finish();
87 | break;
88 |
89 | default:
90 | break;
91 | }
92 | }
93 | }
94 |
--------------------------------------------------------------------------------
/src/com/gizwits/opensource/appkit/ConfigModule/GosConfigModuleBaseActivity.java:
--------------------------------------------------------------------------------
1 | package com.gizwits.opensource.appkit.ConfigModule;
2 |
3 | import java.util.Timer;
4 |
5 | import com.gizwits.gizwifisdk.api.GizWifiSDK;
6 | import com.gizwits.gizwifisdk.enumration.GizWifiErrorCode;
7 | import com.gizwits.gizwifisdk.listener.GizWifiSDKListener;
8 | import com.gizwits.opensource.appkit.CommonModule.GosBaseActivity;
9 | import com.gizwits.opensource.smartlight.R;
10 |
11 | import android.app.AlertDialog;
12 | import android.app.Dialog;
13 | import android.content.Context;
14 | import android.view.MenuItem;
15 | import android.view.View;
16 | import android.view.Window;
17 | import android.view.View.OnClickListener;
18 | import android.widget.EditText;
19 | import android.widget.LinearLayout;
20 |
21 | public class GosConfigModuleBaseActivity extends GosBaseActivity {
22 |
23 | private GizWifiSDKListener gizWifiSDKListener = new GizWifiSDKListener() {
24 |
25 | /** 用于设备配置 */
26 | public void didSetDeviceOnboarding(GizWifiErrorCode result, String mac, String did, String productKey) {
27 | GosConfigModuleBaseActivity.this.didSetDeviceOnboarding(result, mac, did, productKey);
28 | };
29 |
30 | };
31 |
32 | /**
33 | * 设备配置回调
34 | *
35 | * @param result
36 | * 错误码
37 | * @param mac
38 | * MAC
39 | * @param did
40 | * DID
41 | * @param productKey
42 | * PK
43 | */
44 | protected void didSetDeviceOnboarding(GizWifiErrorCode result, String mac, String did, String productKey) {
45 | }
46 |
47 | @Override
48 | protected void onResume() {
49 | super.onResume();
50 | // 每次返回activity都要注册一次sdk监听器,保证sdk状态能正确回调
51 | GizWifiSDK.sharedInstance().setListener(gizWifiSDKListener);
52 | }
53 |
54 | @Override
55 | public boolean onOptionsItemSelected(MenuItem item) {
56 | switch (item.getItemId()) {
57 | case android.R.id.home:
58 | this.finish();
59 | break;
60 | }
61 | return super.onOptionsItemSelected(item);
62 | }
63 |
64 | // 退出提示
65 | protected void quitAlert(Context context) {
66 | final Dialog dialog = new AlertDialog.Builder(this).setView(new EditText(this)).create();
67 | dialog.show();
68 |
69 | Window window = dialog.getWindow();
70 | window.setContentView(R.layout.alert_gos_quit);
71 |
72 | LinearLayout llNo, llSure;
73 | llNo = (LinearLayout) window.findViewById(R.id.llNo);
74 | llSure = (LinearLayout) window.findViewById(R.id.llSure);
75 |
76 | llNo.setOnClickListener(new OnClickListener() {
77 |
78 | @Override
79 | public void onClick(View v) {
80 | dialog.cancel();
81 | }
82 | });
83 |
84 | llSure.setOnClickListener(new OnClickListener() {
85 |
86 | @Override
87 | public void onClick(View v) {
88 | finish();
89 | }
90 | });
91 | }
92 |
93 | // 退出提示
94 | protected void quitAlert(Context context, final Timer timer) {
95 | final Dialog dialog = new AlertDialog.Builder(this).setView(new EditText(this)).create();
96 | dialog.show();
97 |
98 | Window window = dialog.getWindow();
99 | window.setContentView(R.layout.alert_gos_quit);
100 |
101 | LinearLayout llNo, llSure;
102 | llNo = (LinearLayout) window.findViewById(R.id.llNo);
103 | llSure = (LinearLayout) window.findViewById(R.id.llSure);
104 |
105 | llNo.setOnClickListener(new OnClickListener() {
106 |
107 | @Override
108 | public void onClick(View v) {
109 | dialog.cancel();
110 | }
111 | });
112 |
113 | llSure.setOnClickListener(new OnClickListener() {
114 |
115 | @Override
116 | public void onClick(View v) {
117 | if (timer != null) {
118 | timer.cancel();
119 | }
120 | finish();
121 | }
122 | });
123 | }
124 | }
125 |
--------------------------------------------------------------------------------
/src/com/gizwits/opensource/appkit/ConfigModule/GosDeviceReadyActivity.java:
--------------------------------------------------------------------------------
1 | package com.gizwits.opensource.appkit.ConfigModule;
2 |
3 | import com.gizwits.opensource.appkit.CommonModule.GosDeploy;
4 | import com.gizwits.opensource.smartlight.R;
5 |
6 | import android.content.Intent;
7 | import android.os.Bundle;
8 | import android.view.KeyEvent;
9 | import android.view.MenuItem;
10 | import android.view.View;
11 | import android.view.View.OnClickListener;
12 | import android.widget.Button;
13 | import android.widget.CheckBox;
14 | import android.widget.CompoundButton;
15 | import android.widget.CompoundButton.OnCheckedChangeListener;
16 | import android.widget.TextView;
17 |
18 | public class GosDeviceReadyActivity extends GosConfigModuleBaseActivity implements OnClickListener {
19 |
20 | /** The cb Select */
21 | CheckBox cbSelect;
22 |
23 | /** The tv Select */
24 | TextView tvSelect;
25 |
26 | /** The btn Next */
27 | Button btnNext;
28 |
29 | /** The tv NoRedLight */
30 | TextView tvNoRedLight;
31 |
32 | /** The flag */
33 | boolean flag = false;
34 |
35 | @Override
36 | protected void onCreate(Bundle savedInstanceState) {
37 | super.onCreate(savedInstanceState);
38 | setContentView(R.layout.activity_gos_device_ready);
39 | // 设置ActionBar
40 | setActionBar(true, true, R.string.join_by_hands);
41 |
42 | initView();
43 | initEvent();
44 | }
45 |
46 | private void initView() {
47 | cbSelect = (CheckBox) findViewById(R.id.cbSelect);
48 | btnNext = (Button) findViewById(R.id.btnNext);
49 | tvNoRedLight = (TextView) findViewById(R.id.tvNoRedLight);
50 | tvSelect = (TextView) findViewById(R.id.tvSelect);
51 |
52 | // 配置文件部署
53 | btnNext.setBackgroundDrawable(GosDeploy.setButtonBackgroundColor());
54 | btnNext.setTextColor(GosDeploy.setButtonTextColor());
55 |
56 | }
57 |
58 | private void initEvent() {
59 | tvNoRedLight.setOnClickListener(this);
60 | tvSelect.setOnClickListener(this);
61 | btnNext.setOnClickListener(this);
62 | btnNext.setClickable(false);
63 | btnNext.setBackgroundResource(R.drawable.button_shape_gray);
64 |
65 | cbSelect.setOnCheckedChangeListener(new OnCheckedChangeListener() {
66 |
67 | @Override
68 | public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
69 | if (isChecked) {
70 | btnNext.setBackgroundDrawable(GosDeploy.setButtonBackgroundColor());;
71 | btnNext.setClickable(true);
72 | } else {
73 | btnNext.setBackgroundResource(R.drawable.button_shape_gray);
74 | btnNext.setClickable(false);
75 | }
76 |
77 | }
78 | });
79 | }
80 |
81 | @Override
82 | public void onClick(View v) {
83 | switch (v.getId()) {
84 | case R.id.tvNoRedLight:
85 | Intent intent = new Intent(GosDeviceReadyActivity.this, GosDeviceResetActivity.class);
86 | intent.putExtra("flag", "");
87 | startActivity(intent);
88 | finish();
89 | break;
90 |
91 | case R.id.btnNext:
92 | Intent intent2 = new Intent(GosDeviceReadyActivity.this, GosChooseDeviceActivity.class);
93 | startActivity(intent2);
94 | finish();
95 | break;
96 | case R.id.tvSelect:
97 | if (cbSelect.isChecked()) {
98 | cbSelect.setChecked(false);
99 | } else {
100 | cbSelect.setChecked(true);
101 | }
102 | break;
103 |
104 | default:
105 | break;
106 | }
107 | }
108 |
109 | // 屏蔽掉返回键
110 | @Override
111 | public boolean onKeyDown(int keyCode, KeyEvent event) {
112 | if (keyCode == KeyEvent.KEYCODE_BACK) {
113 | quitAlert(this);
114 | return true;
115 | }
116 | return false;
117 | }
118 |
119 | @Override
120 | public boolean onOptionsItemSelected(MenuItem item) {
121 | switch (item.getItemId()) {
122 | case android.R.id.home:
123 | quitAlert(this);
124 | break;
125 | }
126 | return true;
127 | }
128 | }
129 |
--------------------------------------------------------------------------------
/src/com/gizwits/opensource/appkit/ConfigModule/GosDeviceResetActivity.java:
--------------------------------------------------------------------------------
1 | package com.gizwits.opensource.appkit.ConfigModule;
2 |
3 | import com.gizwits.opensource.appkit.CommonModule.GosDeploy;
4 | import com.gizwits.opensource.appkit.view.GifView;
5 | import com.gizwits.opensource.smartlight.R;
6 |
7 | import android.content.Intent;
8 | import android.os.Bundle;
9 | import android.text.TextUtils;
10 | import android.view.KeyEvent;
11 | import android.view.MenuItem;
12 | import android.view.View;
13 | import android.view.View.OnClickListener;
14 | import android.widget.Button;
15 | import android.widget.CheckBox;
16 | import android.widget.CompoundButton;
17 | import android.widget.TextView;
18 | import android.widget.CompoundButton.OnCheckedChangeListener;
19 |
20 | public class GosDeviceResetActivity extends GosConfigModuleBaseActivity implements OnClickListener {
21 |
22 | /** The cb Select */
23 | CheckBox cbSelect;
24 |
25 | /** The tv Select */
26 | TextView tvSelect;
27 |
28 | /** The btn Next */
29 | Button btnNext;
30 |
31 | /** The flag */
32 | String flag;
33 |
34 | @Override
35 | protected void onCreate(Bundle savedInstanceState) {
36 | super.onCreate(savedInstanceState);
37 | setContentView(R.layout.actvity_gos_device_reset);
38 | // 设置ActionBar
39 | setActionBar(true, true, R.string.reset_device);
40 |
41 | initView();
42 | initEvent();
43 | }
44 |
45 | private void initView() {
46 | cbSelect = (CheckBox) findViewById(R.id.cbSelect);
47 | tvSelect = (TextView) findViewById(R.id.tvSelect);
48 | btnNext = (Button) findViewById(R.id.btnNext);
49 |
50 | /** 加载Gif */
51 | GifView gif = (GifView) findViewById(R.id.softreset);
52 | gif.setMovieResource(R.drawable.resetsoftap);
53 |
54 | /** 加载标志位 */
55 | flag = getIntent().getStringExtra("flag").toString();
56 |
57 | // 配置文件部署
58 | btnNext.setBackgroundDrawable(GosDeploy.setButtonBackgroundColor());
59 | btnNext.setTextColor(GosDeploy.setButtonTextColor());
60 |
61 | }
62 |
63 | private void initEvent() {
64 | btnNext.setOnClickListener(this);
65 | tvSelect.setOnClickListener(this);
66 | btnNext.setClickable(false);
67 | btnNext.setBackgroundResource(R.drawable.button_shape_gray);
68 |
69 | cbSelect.setOnCheckedChangeListener(new OnCheckedChangeListener() {
70 |
71 | @Override
72 | public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
73 | if (isChecked) {
74 | btnNext.setBackgroundDrawable(GosDeploy.setButtonBackgroundColor());
75 | btnNext.setClickable(true);
76 | } else {
77 | btnNext.setBackgroundResource(R.drawable.button_shape_gray);
78 | btnNext.setClickable(false);
79 | }
80 |
81 | }
82 | });
83 | }
84 |
85 | @Override
86 | public void onClick(View v) {
87 | switch (v.getId()) {
88 | case R.id.btnNext:
89 | if (TextUtils.isEmpty(flag)) {
90 | Intent intent = new Intent(GosDeviceResetActivity.this, GosChooseDeviceActivity.class);
91 | startActivity(intent);
92 | }
93 | finish();
94 |
95 | break;
96 |
97 | case R.id.tvSelect:
98 | if (cbSelect.isChecked()) {
99 | cbSelect.setChecked(false);
100 | } else {
101 | cbSelect.setChecked(true);
102 | }
103 | break;
104 |
105 | default:
106 | break;
107 | }
108 | }
109 |
110 | @Override
111 | public boolean onOptionsItemSelected(MenuItem item) {
112 | switch (item.getItemId()) {
113 | case android.R.id.home:
114 | if (TextUtils.isEmpty(flag)) {
115 | Intent intent = new Intent(GosDeviceResetActivity.this, GosDeviceReadyActivity.class);
116 | startActivity(intent);
117 | overridePendingTransition(android.R.anim.slide_in_left, android.R.anim.slide_out_right);
118 | }
119 | this.finish();
120 |
121 | break;
122 | }
123 | return true;
124 | }
125 |
126 | @Override
127 | public boolean onKeyDown(int keyCode, KeyEvent event) {
128 | if (keyCode == KeyEvent.KEYCODE_BACK) {
129 | if (TextUtils.isEmpty(flag)) {
130 | Intent intent = new Intent(GosDeviceResetActivity.this, GosDeviceReadyActivity.class);
131 | startActivity(intent);
132 | overridePendingTransition(android.R.anim.slide_in_left, android.R.anim.slide_out_right);
133 | }
134 | this.finish();
135 |
136 | }
137 | return true;
138 | }
139 | }
140 |
--------------------------------------------------------------------------------
/src/com/gizwits/opensource/appkit/ConfigModule/GosModeListActivity.java:
--------------------------------------------------------------------------------
1 | package com.gizwits.opensource.appkit.ConfigModule;
2 |
3 | import java.util.ArrayList;
4 | import java.util.List;
5 |
6 | import com.gizwits.opensource.smartlight.R;
7 |
8 | import android.content.Context;
9 | import android.os.Bundle;
10 | import android.view.View;
11 | import android.view.ViewGroup;
12 | import android.widget.AdapterView;
13 | import android.widget.AdapterView.OnItemClickListener;
14 | import android.widget.BaseAdapter;
15 | import android.widget.ImageView;
16 | import android.widget.ListView;
17 | import android.widget.TextView;
18 |
19 | public class GosModeListActivity extends GosConfigModuleBaseActivity {
20 |
21 | /** The lv Mode */
22 | ListView lvMode;
23 |
24 | /** The data */
25 | List modeList;
26 |
27 | /** The Adapter */
28 | ModeListAdapter modeListAdapter;
29 |
30 | @Override
31 | protected void onCreate(Bundle savedInstanceState) {
32 | super.onCreate(savedInstanceState);
33 | setContentView(R.layout.activity_gos_modelist);
34 | // 设置ActionBar
35 | setActionBar(true, true, R.string.choose_mode_title);
36 | initData();
37 | initView();
38 | initEvent();
39 | }
40 |
41 | private void initView() {
42 | lvMode = (ListView) findViewById(R.id.lvMode);
43 |
44 | lvMode.setAdapter(modeListAdapter);// 初始化
45 | }
46 |
47 | private void initEvent() {
48 |
49 | lvMode.setOnItemClickListener(new OnItemClickListener() {
50 |
51 | @Override
52 | public void onItemClick(AdapterView> arg0, View arg1, int arg2, long arg3) {
53 |
54 | GosAirlinkChooseDeviceWorkWiFiActivity.modeNum = arg2;
55 | finish();
56 | }
57 | });
58 | }
59 |
60 | private void initData() {
61 | modeList = new ArrayList();
62 | String[] modes = this.getResources().getStringArray(R.array.mode);
63 | for (String string : modes) {
64 | modeList.add(string);
65 | }
66 | modeListAdapter = new ModeListAdapter(this, modeList);
67 | }
68 |
69 | class ModeListAdapter extends BaseAdapter {
70 |
71 | Context context;
72 | List modeList;
73 |
74 | public ModeListAdapter(Context context, List modeList) {
75 | super();
76 | this.context = context;
77 | this.modeList = modeList;
78 | }
79 |
80 | @Override
81 | public int getCount() {
82 | return modeList.size();
83 | }
84 |
85 | @Override
86 | public Object getItem(int position) {
87 | return null;
88 | }
89 |
90 | @Override
91 | public long getItemId(int position) {
92 | return 0;
93 | }
94 |
95 | @Override
96 | public View getView(int position, View convertView, ViewGroup parent) {
97 | if (null == convertView) {
98 | convertView = View.inflate(context, R.layout.item_gos_mode_list, null);
99 | }
100 |
101 | TextView tvModeText = (TextView) convertView.findViewById(R.id.tvModeText);
102 |
103 | String modeText = modeList.get(position);
104 | tvModeText.setText(modeText);
105 |
106 | ImageView ivChoosed = (ImageView) convertView.findViewById(R.id.ivChoosed);
107 | int i = GosAirlinkChooseDeviceWorkWiFiActivity.modeNum;
108 | if (position == i) {
109 | ivChoosed.setVisibility(View.VISIBLE);
110 | }
111 |
112 | return convertView;
113 | }
114 |
115 | }
116 |
117 | }
118 |
--------------------------------------------------------------------------------
/src/com/gizwits/opensource/appkit/ConfigModule/GosWifiChangeReciver.java:
--------------------------------------------------------------------------------
1 | package com.gizwits.opensource.appkit.ConfigModule;
2 |
3 | import com.gizwits.opensource.appkit.CommonModule.GosBaseActivity;
4 | import com.gizwits.opensource.appkit.CommonModule.WifiAutoConnectManager;
5 | import com.gizwits.opensource.appkit.utils.NetUtils;
6 |
7 | import android.content.BroadcastReceiver;
8 | import android.content.Context;
9 | import android.content.Intent;
10 | import android.content.SharedPreferences;
11 | import android.net.wifi.WifiManager;
12 |
13 | public class GosWifiChangeReciver extends BroadcastReceiver {
14 |
15 | SharedPreferences spf;
16 |
17 | @Override
18 | public void onReceive(Context context, Intent intent) {
19 |
20 | spf = context.getSharedPreferences(GosBaseActivity.SPF_Name, Context.MODE_PRIVATE);
21 |
22 | String wifiname = spf.getString("workSSID", "");
23 | String wifipass = spf.getString("workSSIDPsw", "");
24 | String connectWifiSsid = NetUtils.getConnectWifiSsid(context);
25 | if (connectWifiSsid != null && connectWifiSsid.contains(GosBaseActivity.SoftAP_Start)) {
26 | } else {
27 |
28 | if (connectWifiSsid.contains(wifiname)) {
29 |
30 | return;
31 | }
32 | WifiManager wifiManager = (WifiManager) context.getSystemService(Context.WIFI_SERVICE);
33 | WifiAutoConnectManager manager = new WifiAutoConnectManager(wifiManager);
34 | manager.connect(wifiname, wifipass, WifiAutoConnectManager.getCipherType(context, wifiname));
35 | }
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/src/com/gizwits/opensource/appkit/ControlModule/GosDeviceControlActivity.java:
--------------------------------------------------------------------------------
1 | package com.gizwits.opensource.appkit.ControlModule;
2 |
3 | import com.gizwits.gizwifisdk.api.GizWifiDevice;
4 | import com.gizwits.opensource.appkit.CommonModule.GosBaseActivity;
5 | import com.gizwits.opensource.smartlight.R;
6 |
7 | import android.app.ActionBar;
8 | import android.content.Intent;
9 | import android.os.Bundle;
10 | import android.util.Log;
11 | import android.view.MenuItem;
12 | import android.widget.TextView;
13 |
14 | public class GosDeviceControlActivity extends GosBaseActivity {
15 |
16 | /** The tv MAC */
17 | private TextView tvMAC;
18 |
19 | /** The GizWifiDevice device */
20 | private GizWifiDevice device;
21 |
22 | /** The ActionBar actionBar */
23 | ActionBar actionBar;
24 |
25 | @Override
26 | protected void onCreate(Bundle savedInstanceState) {
27 | // TODO Auto-generated method stub
28 | super.onCreate(savedInstanceState);
29 | setContentView(R.layout.activity_gos_device_control);
30 | initDevice();
31 | // 设置ActionBar
32 | setActionBar(true, true, device.getProductName());
33 | initView();
34 | }
35 |
36 | private void initView() {
37 | tvMAC = (TextView) findViewById(R.id.tvMAC);
38 | if (null != device) {
39 | tvMAC.setText(device.getMacAddress().toString());
40 | }
41 | }
42 |
43 | private void initDevice() {
44 | Intent intent = getIntent();
45 | device = (GizWifiDevice) intent.getParcelableExtra("GizWifiDevice");
46 | Log.i("Apptest", device.getDid());
47 | }
48 |
49 | @Override
50 | public boolean onOptionsItemSelected(MenuItem item) {
51 | switch (item.getItemId()) {
52 | case android.R.id.home:
53 | this.finish();
54 | break;
55 | }
56 | return super.onOptionsItemSelected(item);
57 | }
58 |
59 | }
60 |
--------------------------------------------------------------------------------
/src/com/gizwits/opensource/appkit/GosApplication.java:
--------------------------------------------------------------------------------
1 | package com.gizwits.opensource.appkit;
2 |
3 | import java.util.concurrent.ConcurrentHashMap;
4 |
5 | import com.gizwits.gizwifisdk.api.GizWifiSDK;
6 | import com.gizwits.gizwifisdk.enumration.GizEventType;
7 | import com.gizwits.gizwifisdk.enumration.GizLogPrintLevel;
8 | import com.gizwits.gizwifisdk.enumration.GizWifiErrorCode;
9 | import com.gizwits.gizwifisdk.listener.GizWifiSDKListener;
10 | import com.gizwits.opensource.appkit.CommonModule.GosDeploy;
11 | import android.annotation.SuppressLint;
12 | import android.app.Application;
13 | import android.os.Handler;
14 | import android.text.TextUtils;
15 | import android.util.Log;
16 | import android.widget.Toast;
17 |
18 | public class GosApplication extends Application {
19 |
20 | public static int flag = 0;
21 |
22 | GosDeploy gosDeploy;
23 |
24 | ConcurrentHashMap cloudServiceMap = new ConcurrentHashMap();
25 |
26 | @SuppressLint("HandlerLeak")
27 | Handler handler = new Handler() {
28 | public void handleMessage(android.os.Message msg) {
29 |
30 | // 设置日志打印级别 (默认all且生成文件至SD卡)
31 | GizWifiSDK.sharedInstance().setLogLevel(GizLogPrintLevel.GizLogPrintAll);
32 |
33 | cloudServiceMap = GosDeploy.setCloudService();
34 |
35 | if (!cloudServiceMap.isEmpty()) {
36 | // 设置云端服务
37 | GizWifiSDK.sharedInstance().setCloudService(cloudServiceMap);
38 | }
39 |
40 | };
41 | };
42 |
43 | GizWifiSDKListener gizWifiSDKListener = new GizWifiSDKListener() {
44 |
45 | public void didNotifyEvent(com.gizwits.gizwifisdk.enumration.GizEventType eventType, Object eventSource,
46 | com.gizwits.gizwifisdk.enumration.GizWifiErrorCode eventID, String eventMessage) {
47 | if (GizEventType.GizEventSDK == eventType && GizWifiErrorCode.GIZ_SDK_START_SUCCESS == eventID) {
48 |
49 | } else {
50 | Log.e("Apptest", "SDK UN OPEN/n" + eventMessage);
51 | }
52 | };
53 |
54 | public void didGetCurrentCloudService(GizWifiErrorCode result,
55 | java.util.concurrent.ConcurrentHashMap cloudServiceInfo) {
56 |
57 | if (GizWifiErrorCode.GIZ_SDK_SUCCESS != result) {
58 | Log.e("Apptest", "CloudService Error: " + result.toString());
59 | }
60 | };
61 | };
62 |
63 | public void onCreate() {
64 | super.onCreate();
65 |
66 | // 读取配置文件
67 | gosDeploy = new GosDeploy(this);
68 | String AppID = GosDeploy.setAppID();
69 | String AppSecret = GosDeploy.setAppSecret();
70 |
71 | if (TextUtils.isEmpty(AppID) || AppID.contains("your_app_id") || TextUtils.isEmpty(AppSecret)
72 | || AppSecret.contains("your_app_secret")) {
73 | if (flag == 0) {
74 |
75 | }
76 | flag++;
77 | } else {
78 |
79 | // 启动SDK
80 | GizWifiSDK.sharedInstance().startWithAppID(getApplicationContext(), AppID, null, null);
81 |
82 | // 设置日志等级和云端服务
83 | handler.sendEmptyMessageDelayed(0, 3000);
84 |
85 | }
86 | };
87 | }
88 |
--------------------------------------------------------------------------------
/src/com/gizwits/opensource/appkit/PushModule/BaiDuPushReceiver.java:
--------------------------------------------------------------------------------
1 | package com.gizwits.opensource.appkit.PushModule;
2 |
3 | import java.util.List;
4 |
5 | import com.baidu.android.pushservice.PushMessageReceiver;
6 |
7 | import android.content.Context;
8 | import android.util.Log;
9 |
10 | public class BaiDuPushReceiver extends PushMessageReceiver {
11 |
12 | // BaiDuPush_Channel_ID(此处需要在百度推送的Receiver里赋值)
13 | public static String BaiDuPush_Channel_ID;
14 |
15 | @Override
16 | public void onBind(Context arg0, int arg1, String arg2, String arg3, String arg4, String arg5) {
17 | // TODO Auto-generated method stub
18 | BaiDuPush_Channel_ID = arg4;
19 | Log.i("Apptest", BaiDuPush_Channel_ID);
20 |
21 | }
22 |
23 | @Override
24 | public void onDelTags(Context arg0, int arg1, List arg2, List arg3, String arg4) {
25 | // TODO Auto-generated method stub
26 |
27 | }
28 |
29 | @Override
30 | public void onListTags(Context arg0, int arg1, List arg2, String arg3) {
31 | // TODO Auto-generated method stub
32 |
33 | }
34 |
35 | @Override
36 | public void onMessage(Context arg0, String arg1, String arg2) {
37 | // TODO Auto-generated method stub
38 |
39 | }
40 |
41 | @Override
42 | public void onNotificationArrived(Context arg0, String arg1, String arg2, String arg3) {
43 | // TODO Auto-generated method stub
44 |
45 | }
46 |
47 | @Override
48 | public void onNotificationClicked(Context arg0, String arg1, String arg2, String arg3) {
49 | // TODO Auto-generated method stub
50 |
51 | }
52 |
53 | @Override
54 | public void onSetTags(Context arg0, int arg1, List arg2, List arg3, String arg4) {
55 | // TODO Auto-generated method stub
56 |
57 | }
58 |
59 | @Override
60 | public void onUnbind(Context arg0, int arg1, String arg2) {
61 | // TODO Auto-generated method stub
62 |
63 | }
64 |
65 | }
66 |
--------------------------------------------------------------------------------
/src/com/gizwits/opensource/appkit/PushModule/GosPushManager.java:
--------------------------------------------------------------------------------
1 | package com.gizwits.opensource.appkit.PushModule;
2 |
3 | import java.util.Set;
4 |
5 | import com.baidu.android.pushservice.PushConstants;
6 | import com.baidu.android.pushservice.PushManager;
7 | import com.gizwits.gizwifisdk.api.GizWifiSDK;
8 | import com.gizwits.gizwifisdk.enumration.GizPushType;
9 | import com.gizwits.opensource.appkit.CommonModule.GosDeploy;
10 | import com.gizwits.opensource.smartlight.R;
11 |
12 | import android.content.Context;
13 | import android.text.TextUtils;
14 | import android.util.Log;
15 | import android.widget.Toast;
16 | import cn.jpush.android.api.JPushInterface;
17 | import cn.jpush.android.api.TagAliasCallback;
18 |
19 | public class GosPushManager {
20 |
21 | static GizPushType gizPushType;
22 |
23 | static Context context;
24 |
25 | public GosPushManager(int PushType, Context context) {
26 | super();
27 | GosPushManager.context = context;
28 | if (PushType == 1) {
29 | GosPushManager.gizPushType = GizPushType.GizPushJiGuang;
30 | jPush();
31 | } else if (PushType == 2) {
32 | GosPushManager.gizPushType = GizPushType.GizPushBaiDu;
33 | bDPush();
34 | } else {
35 |
36 | }
37 |
38 | }
39 |
40 | /** Channel_ID */
41 | public static String Channel_ID;
42 |
43 | /**
44 | * 此方法完成了初始化JPush SDK等功能 但仍需在MainActivity的onResume和onPause添加相应方法
45 | * JPushInterface.onResume(context); JPushInterface.onPause(context);
46 | *
47 | * @param context
48 | */
49 | public void jPush() {
50 | // 设置JPush调试模式
51 | JPushInterface.setDebugMode(true);
52 |
53 | // 初始化JPushSDK
54 | JPushInterface.init(context);
55 |
56 | }
57 |
58 | public void bDPush() {
59 | String BDPushAppKey = GosDeploy.setBaiDuPushAppKey();
60 | if (TextUtils.isEmpty(BDPushAppKey) || BDPushAppKey.contains("your_bpush_api_key")) {
61 | Toast.makeText(context, R.string.BDPushAppID_Toast, 2000).show();
62 | } else {
63 | PushManager.startWork(context, PushConstants.LOGIN_TYPE_API_KEY, BDPushAppKey);
64 | }
65 |
66 | }
67 |
68 | /**
69 | * 向云端绑定推送
70 | *
71 | * @param Token
72 | * @param Channel_ID
73 | * @param gizPushType
74 | */
75 | public static void pushBindService(String token) {
76 |
77 | if (GizPushType.GizPushJiGuang == gizPushType) {
78 | // 获取JPush的RegistrationID,即Channel_ID
79 | Channel_ID = JPushInterface.getRegistrationID(context);
80 |
81 | // 设定JPush类型
82 | JPushInterface.setAlias(context, Channel_ID, new TagAliasCallback() {
83 | @Override
84 | public void gotResult(int arg0, String arg1, Set arg2) {
85 | if (arg0 == 0) {
86 | Log.i("Apptest", "Alias: " + arg1);
87 | } else {
88 | Log.e("Apptest", "Result: " + arg0);
89 | }
90 | }
91 | });
92 |
93 | } else if (GizPushType.GizPushBaiDu == gizPushType) {
94 | // 获取BDPush的Channel_ID
95 | Channel_ID = BaiDuPushReceiver.BaiDuPush_Channel_ID;
96 | } else {
97 | return;
98 | }
99 |
100 | // TODO 绑定推送
101 | Log.i("Apptest", Channel_ID + "\n" + gizPushType.toString() + "\n" + token);
102 | GizWifiSDK.sharedInstance().channelIDBind(token, Channel_ID, gizPushType);
103 | }
104 |
105 | public static void pushUnBindService(String token) {
106 |
107 | if (token.isEmpty()) {
108 | return;
109 | }
110 |
111 | if (GizPushType.GizPushJiGuang == gizPushType) {
112 | // 获取JPush的RegistrationID,即Channel_ID
113 | Channel_ID = JPushInterface.getRegistrationID(context);
114 | } else if (GizPushType.GizPushBaiDu == gizPushType) {
115 | // 获取BDPush的Channel_ID
116 | Channel_ID = BaiDuPushReceiver.BaiDuPush_Channel_ID;
117 | } else {
118 | return;
119 | }
120 | // TODO 绑定推送
121 | Log.i("Apptest", Channel_ID + "\n" + gizPushType.toString() + "\n" + token);
122 | GizWifiSDK.sharedInstance().channelIDUnBind(token, Channel_ID);
123 | }
124 | }
125 |
--------------------------------------------------------------------------------
/src/com/gizwits/opensource/appkit/PushModule/JPushReceiver.java:
--------------------------------------------------------------------------------
1 | package com.gizwits.opensource.appkit.PushModule;
2 |
3 | import android.content.BroadcastReceiver;
4 | import android.content.Context;
5 | import android.content.Intent;
6 |
7 | public class JPushReceiver extends BroadcastReceiver {
8 |
9 | @Override
10 | public void onReceive(Context context, Intent intent) {
11 | // TODO Auto-generated method stub
12 |
13 | }
14 |
15 | }
16 |
--------------------------------------------------------------------------------
/src/com/gizwits/opensource/appkit/SettingsModule/GosAboutActivity.java:
--------------------------------------------------------------------------------
1 | package com.gizwits.opensource.appkit.SettingsModule;
2 |
3 | import com.gizwits.gizwifisdk.api.GizWifiSDK;
4 | import com.gizwits.opensource.appkit.CommonModule.GosBaseActivity;
5 | import com.gizwits.opensource.smartlight.R;
6 |
7 | import android.app.ActionBar;
8 | import android.content.Context;
9 | import android.content.pm.PackageInfo;
10 | import android.content.pm.PackageManager;
11 | import android.os.Bundle;
12 | import android.util.Log;
13 | import android.view.MenuItem;
14 | import android.widget.TextView;
15 |
16 | public class GosAboutActivity extends GosBaseActivity {
17 |
18 | /** The tv SDKVersion. */
19 | TextView tv_SDKVersion;
20 |
21 | /** the tv appCode */
22 | TextView tv_AppVersion;
23 |
24 | /** The ActionBar */
25 | ActionBar actionBar;
26 |
27 | @Override
28 | protected void onCreate(Bundle savedInstanceState) {
29 | super.onCreate(savedInstanceState);
30 | setContentView(R.layout.activity_gos_about);
31 | // 设置ActionBar
32 | setActionBar(true, true, R.string.about);
33 |
34 | initView();
35 |
36 | }
37 |
38 | /**
39 | * Inits the view.
40 | */
41 | private void initView() {
42 | tv_SDKVersion = (TextView) findViewById(R.id.versionCode);
43 | tv_AppVersion = (TextView) findViewById(R.id.appCode);
44 | }
45 |
46 | @Override
47 | public void onResume() {
48 | super.onResume();
49 | // tv_SDKVersion.setText("V" + GizWifiSDK.sharedInstance().getVersion().toString());
50 | tv_SDKVersion.setText(GizWifiSDK.sharedInstance().getVersion().toString());
51 | tv_AppVersion.setText(getAppVersionName(this));
52 | }
53 |
54 | /**
55 | * 返回当前程序版本名
56 | */
57 | public static String getAppVersionName(Context context) {
58 | String versionName = "";
59 | try {
60 | // ---get the package info---
61 | PackageManager pm = context.getPackageManager();
62 | PackageInfo pi = pm.getPackageInfo(context.getPackageName(), 0);
63 | versionName = pi.versionName;
64 | if (versionName == null || versionName.length() <= 0) {
65 | return "";
66 | }
67 | } catch (Exception e) {
68 | Log.e("Apptest", "Exception", e);
69 | }
70 | return versionName;
71 | }
72 |
73 | @Override
74 | public boolean onOptionsItemSelected(MenuItem item) {
75 | switch (item.getItemId()) {
76 | case android.R.id.home:
77 | this.finish();
78 | break;
79 | }
80 | return super.onOptionsItemSelected(item);
81 | }
82 |
83 | }
84 |
--------------------------------------------------------------------------------
/src/com/gizwits/opensource/appkit/SettingsModule/GosSettiingsActivity.java:
--------------------------------------------------------------------------------
1 | package com.gizwits.opensource.appkit.SettingsModule;
2 |
3 | import com.gizwits.opensource.appkit.CommonModule.GosBaseActivity;
4 | import com.gizwits.opensource.smartlight.R;
5 |
6 | import android.content.Intent;
7 | import android.os.Bundle;
8 | import android.view.MenuItem;
9 | import android.view.View;
10 | import android.view.View.OnClickListener;
11 | import android.widget.LinearLayout;
12 |
13 | public class GosSettiingsActivity extends GosBaseActivity implements OnClickListener {
14 |
15 | /** The ll About */
16 | private LinearLayout llAbout;
17 |
18 | /** The Intent */
19 | Intent intent;
20 |
21 | @Override
22 | protected void onCreate(Bundle savedInstanceState) {
23 | // TODO Auto-generated method stub
24 | super.onCreate(savedInstanceState);
25 | setContentView(R.layout.activity_gos_settings);
26 | // 设置ActionBar
27 | setActionBar(true, true, R.string.site);
28 |
29 | initView();
30 | initEvent();
31 | }
32 |
33 | private void initView() {
34 | llAbout = (LinearLayout) findViewById(R.id.llAbout);
35 | }
36 |
37 | private void initEvent() {
38 | llAbout.setOnClickListener(this);
39 | }
40 |
41 | @Override
42 | public void onClick(View v) {
43 | switch (v.getId()) {
44 | case R.id.llAbout:
45 | intent = new Intent(GosSettiingsActivity.this, GosAboutActivity.class);
46 | startActivity(intent);
47 | break;
48 |
49 | default:
50 | break;
51 | }
52 |
53 | }
54 |
55 | @Override
56 | public boolean onOptionsItemSelected(MenuItem item) {
57 | switch (item.getItemId()) {
58 | case android.R.id.home:
59 | this.finish();
60 | break;
61 | }
62 | return super.onOptionsItemSelected(item);
63 | }
64 |
65 | }
66 |
--------------------------------------------------------------------------------
/src/com/gizwits/opensource/appkit/ThirdAccountModule/BaseUiListener.java:
--------------------------------------------------------------------------------
1 | package com.gizwits.opensource.appkit.ThirdAccountModule;
2 |
3 | import org.json.JSONObject;
4 |
5 | import com.tencent.tauth.IUiListener;
6 | import com.tencent.tauth.UiError;
7 |
8 | public class BaseUiListener implements IUiListener {
9 |
10 | @Override
11 | public void onCancel() {
12 | // TODO Auto-generated method stub
13 | }
14 |
15 | @Override
16 | public void onComplete(Object arg0) {
17 | doComplete((JSONObject)arg0);
18 | }
19 |
20 | protected void doComplete(JSONObject values) {
21 | }
22 |
23 | @Override
24 | public void onError(UiError arg0) {
25 | // TODO Auto-generated method stu
26 | }
27 |
28 | }
29 |
--------------------------------------------------------------------------------
/src/com/gizwits/opensource/appkit/UserModule/GosUserModuleBaseActivity.java:
--------------------------------------------------------------------------------
1 | package com.gizwits.opensource.appkit.UserModule;
2 |
3 | import com.gizwits.gizwifisdk.api.GizWifiSDK;
4 | import com.gizwits.gizwifisdk.enumration.GizWifiErrorCode;
5 | import com.gizwits.gizwifisdk.listener.GizWifiSDKListener;
6 | import com.gizwits.opensource.appkit.CommonModule.GosBaseActivity;
7 | import android.view.MenuItem;
8 |
9 | public class GosUserModuleBaseActivity extends GosBaseActivity {
10 |
11 | private GizWifiSDKListener gizWifiSDKListener = new GizWifiSDKListener() {
12 |
13 | /** 用于用户登录 */
14 | public void didUserLogin(GizWifiErrorCode result, String uid, String token) {
15 | GosUserModuleBaseActivity.this.didUserLogin(result, uid, token);
16 | };
17 |
18 | /** 用于手机验证码 */
19 | public void didRequestSendPhoneSMSCode(GizWifiErrorCode result, String token) {
20 | GosUserModuleBaseActivity.this.didRequestSendPhoneSMSCode(result, token);
21 |
22 | };
23 |
24 | /** 用于用户注册 */
25 | public void didRegisterUser(GizWifiErrorCode result, String uid, String token) {
26 | GosUserModuleBaseActivity.this.didRegisterUser(result, uid, token);
27 | };
28 |
29 | /** 用于重置密码 */
30 | public void didChangeUserPassword(GizWifiErrorCode result) {
31 | GosUserModuleBaseActivity.this.didChangeUserPassword(result);
32 | };
33 |
34 | /** 用于解绑推送 */
35 | public void didChannelIDUnBind(GizWifiErrorCode result) {
36 | GosUserModuleBaseActivity.this.didChannelIDUnBind(result);
37 | };
38 |
39 | };
40 |
41 | /**
42 | * 用户登录回调
43 | *
44 | * @param result
45 | * 错误码
46 | * @param uid
47 | * 用户ID
48 | * @param token
49 | * 授权令牌
50 | */
51 | protected void didUserLogin(GizWifiErrorCode result, String uid, String token) {
52 | };
53 |
54 | /**
55 | * 手机验证码回调
56 | *
57 | * @param result
58 | * 错误码
59 | * @param token
60 | * 口令
61 | */
62 | protected void didRequestSendPhoneSMSCode(GizWifiErrorCode result, String token) {
63 | };
64 |
65 | /**
66 | * 用户注册回调
67 | *
68 | * @param result
69 | * 错误码
70 | * @param uid
71 | * 用户ID
72 | * @param token
73 | * 授权令牌
74 | */
75 | protected void didRegisterUser(GizWifiErrorCode result, String uid, String token) {
76 | };
77 |
78 | /**
79 | * 重置密码回调
80 | *
81 | * @param result
82 | * 错误码
83 | */
84 | protected void didChangeUserPassword(GizWifiErrorCode result) {
85 | };
86 |
87 | /**
88 | * 解绑推送回调
89 | *
90 | * @param result
91 | * 错误码
92 | */
93 | protected void didChannelIDUnBind(GizWifiErrorCode result) {
94 | };
95 |
96 | @Override
97 | protected void onResume() {
98 | super.onResume();
99 | // 每次返回activity都要注册一次sdk监听器,保证sdk状态能正确回调
100 | GizWifiSDK.sharedInstance().setListener(gizWifiSDKListener);
101 | }
102 |
103 | @Override
104 | public boolean onOptionsItemSelected(MenuItem item) {
105 | switch (item.getItemId()) {
106 | case android.R.id.home:
107 | this.finish();
108 | break;
109 | }
110 | return super.onOptionsItemSelected(item);
111 | }
112 |
113 |
114 | }
115 |
--------------------------------------------------------------------------------
/src/com/gizwits/opensource/appkit/utils/HTTPSTrustManager.java:
--------------------------------------------------------------------------------
1 | package com.gizwits.opensource.appkit.utils;
2 | import java.security.KeyManagementException;
3 | import java.security.NoSuchAlgorithmException;
4 | import java.security.SecureRandom;
5 | import java.security.cert.X509Certificate;
6 |
7 | import javax.net.ssl.HostnameVerifier;
8 | import javax.net.ssl.HttpsURLConnection;
9 | import javax.net.ssl.SSLContext;
10 | import javax.net.ssl.SSLSession;
11 | import javax.net.ssl.TrustManager;
12 | import javax.net.ssl.X509TrustManager;
13 | /**
14 | * @description 有一个信任管理器类负责决定是否信任远端的证书 X509TrustManager,更多移动开发内容请关注: http://blog.csdn.net/xiong_it
15 | * @charset UTF-8
16 | * @author xiong_it
17 | * @date 2015-7-16下午5:38:38
18 | * @version
19 | */
20 | public class HTTPSTrustManager implements X509TrustManager {
21 |
22 | private static TrustManager[] trustManagers;
23 | private static final X509Certificate[] _AcceptedIssuers = new X509Certificate[] {};
24 |
25 | /**
26 | * 该方法检查客户端的证书,若不信任该证书则抛出异常。由于我们不需要对客户端进行认证,
27 | * 因此我们只需要执行默认的信任管理器的这个方法。JSSE中,默认的信任管理器类为TrustManager。
28 | */
29 | @Override
30 | public void checkClientTrusted(
31 | java.security.cert.X509Certificate[] x509Certificates, String s)
32 | throws java.security.cert.CertificateException {
33 | // To change body of implemented methods use File | Settings | File
34 | // Templates.
35 | }
36 |
37 | /**
38 | * 该方法检查服务器的证书,若不信任该证书同样抛出异常。通过自己实现该方法,可以使之信任我们指定的任何证书。在实现该方法时,
39 | * 也可以简单的不做任何处理,即一个空的函数体,由于不会抛出异常,它就会信任任何证书。
40 | */
41 | @Override
42 | public void checkServerTrusted(
43 | java.security.cert.X509Certificate[] x509Certificates, String s)
44 | throws java.security.cert.CertificateException {
45 | // To change body of implemented methods use File | Settings | File
46 | // Templates.
47 | }
48 |
49 | public boolean isClientTrusted(X509Certificate[] chain) {
50 | return true;
51 | }
52 |
53 | public boolean isServerTrusted(X509Certificate[] chain) {
54 | return true;
55 | }
56 |
57 | @Override
58 | public X509Certificate[] getAcceptedIssuers() {
59 | return _AcceptedIssuers;
60 | }
61 |
62 | public static void allowAllSSL() {
63 | HttpsURLConnection.setDefaultHostnameVerifier(new HostnameVerifier() {
64 |
65 | @Override
66 | public boolean verify(String arg0, SSLSession arg1) {
67 | return true;
68 | }
69 |
70 | });
71 |
72 | SSLContext context = null;
73 | if (trustManagers == null) {
74 | trustManagers = new TrustManager[] { new HTTPSTrustManager() };
75 | }
76 |
77 | try {
78 | context = SSLContext.getInstance("TLS");
79 | context.init(null, trustManagers, new SecureRandom());
80 | } catch (NoSuchAlgorithmException e) {
81 | e.printStackTrace();
82 | } catch (KeyManagementException e) {
83 | e.printStackTrace();
84 | }
85 |
86 | HttpsURLConnection.setDefaultSSLSocketFactory(context
87 | .getSocketFactory());
88 | }
89 |
90 | }
--------------------------------------------------------------------------------
/src/com/gizwits/opensource/appkit/utils/JsonUtils.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (C) 2014-2015 Imtoy Technologies. All rights reserved.
3 | * @charset UTF-8
4 | * @author xiongxunxiang
5 | */
6 | package com.gizwits.opensource.appkit.utils;
7 |
8 | import java.io.BufferedReader;
9 | import java.io.IOException;
10 | import java.io.InputStreamReader;
11 |
12 | import org.apache.http.HttpEntity;
13 | import org.apache.http.HttpResponse;
14 | import org.apache.http.client.ClientProtocolException;
15 | import org.apache.http.client.methods.HttpGet;
16 | import org.apache.http.conn.ClientConnectionManager;
17 | import org.apache.http.conn.scheme.PlainSocketFactory;
18 | import org.apache.http.conn.scheme.Scheme;
19 | import org.apache.http.conn.scheme.SchemeRegistry;
20 | import org.apache.http.impl.client.DefaultHttpClient;
21 | import org.apache.http.impl.conn.tsccm.ThreadSafeClientConnManager;
22 | import org.apache.http.params.BasicHttpParams;
23 | import org.apache.http.params.HttpConnectionParams;
24 | import org.apache.http.params.HttpParams;
25 | import org.json.JSONException;
26 | import org.json.JSONObject;
27 |
28 |
29 | import android.util.Log;
30 |
31 | /**
32 | * @description 更多移动开发内容请关注: http://blog.csdn.net/xiong_it
33 | * @charset UTF-8
34 | * @author xiong_it
35 | * @date 2015-7-16下午5:41:05
36 | * @version
37 | */
38 | public class JsonUtils {
39 | public static JSONObject initSSLWithHttpClinet(String path)
40 | throws ClientProtocolException, IOException {
41 | HTTPSTrustManager.allowAllSSL();
42 | JSONObject jsonObject = null;
43 | int timeOut = 30 * 1000;
44 | HttpParams param = new BasicHttpParams();
45 | HttpConnectionParams.setConnectionTimeout(param, timeOut);
46 | HttpConnectionParams.setSoTimeout(param, timeOut);
47 | HttpConnectionParams.setTcpNoDelay(param, true);
48 |
49 | SchemeRegistry registry = new SchemeRegistry();
50 | registry.register(new Scheme("http", PlainSocketFactory .getSocketFactory(), 80));
51 | registry.register(new Scheme("https", TrustAllSSLSocketFactory .getDefault(), 443));
52 | ClientConnectionManager manager = new ThreadSafeClientConnManager( param, registry);
53 | DefaultHttpClient client = new DefaultHttpClient(manager, param);
54 |
55 | HttpGet request = new HttpGet(path);
56 | // HttpGet request = new HttpGet("https://www.alipay.com/");
57 | HttpResponse response = client.execute(request);
58 | HttpEntity entity = response.getEntity();
59 | BufferedReader reader = new BufferedReader(new InputStreamReader( entity.getContent()));
60 | StringBuilder result = new StringBuilder();
61 | String line = "";
62 | while ((line = reader.readLine()) != null) {
63 | result.append(line);
64 | try {
65 | jsonObject = new JSONObject(line);
66 | } catch (JSONException e) {
67 | e.printStackTrace();
68 | }
69 | }
70 | Log.e("HTTPS TEST", result.toString());
71 | return jsonObject;
72 | }
73 | }
74 |
--------------------------------------------------------------------------------
/src/com/gizwits/opensource/appkit/utils/TrustAllSSLSocketFactory.java:
--------------------------------------------------------------------------------
1 | package com.gizwits.opensource.appkit.utils;
2 |
3 | import java.io.IOException;
4 | import java.lang.reflect.Field;
5 | import java.net.InetAddress;
6 | import java.net.Socket;
7 | import java.net.UnknownHostException;
8 | import java.security.KeyManagementException;
9 | import java.security.KeyStoreException;
10 | import java.security.NoSuchAlgorithmException;
11 | import java.security.UnrecoverableKeyException;
12 | import java.security.cert.CertificateException;
13 | import java.security.cert.X509Certificate;
14 |
15 | import javax.net.ssl.SSLContext;
16 | import javax.net.ssl.SSLException;
17 | import javax.net.ssl.SSLSession;
18 | import javax.net.ssl.SSLSocket;
19 | import javax.net.ssl.TrustManager;
20 | import javax.net.ssl.X509TrustManager;
21 |
22 | import org.apache.http.conn.scheme.SocketFactory;
23 | import org.apache.http.conn.ssl.SSLSocketFactory;
24 | import org.apache.http.conn.ssl.X509HostnameVerifier;
25 |
26 | import android.os.Build;
27 |
28 | /**
29 | *
30 | * @description ssl安全链接工厂 更多移动开发内容请关注: http://blog.csdn.net/xiong_it
31 | * @charset UTF-8
32 | * @author xiong_it
33 | * @date 2015-7-20下午4:43:25
34 | * @version
35 | */
36 | public class TrustAllSSLSocketFactory extends SSLSocketFactory {
37 |
38 | private javax.net.ssl.SSLSocketFactory factory;
39 | private static TrustAllSSLSocketFactory instance;
40 |
41 | private TrustAllSSLSocketFactory() throws KeyManagementException, UnrecoverableKeyException,
42 | NoSuchAlgorithmException, KeyStoreException {
43 | super(null);
44 |
45 | SSLContext context = SSLContext.getInstance("TLS");
46 | context.init(null, new TrustManager[] { new TrustAllManager() }, null);
47 | factory = context.getSocketFactory();
48 | setHostnameVerifier(new X509HostnameVerifier() {
49 |
50 | @Override
51 | public void verify(String host, String[] cns, String[] subjectAlts) throws SSLException {
52 |
53 | }
54 |
55 | @Override
56 | public void verify(String host, X509Certificate cert) throws SSLException {
57 |
58 | }
59 |
60 | @Override
61 | public void verify(String host, SSLSocket ssl) throws IOException {
62 |
63 | }
64 |
65 | @Override
66 | public boolean verify(String host, SSLSession session) {
67 | return true;
68 | }
69 | });
70 | }
71 |
72 | public static SocketFactory getDefault() {
73 | if (instance == null) {
74 | try {
75 | instance = new TrustAllSSLSocketFactory();
76 | } catch (Exception e) {
77 | e.printStackTrace();
78 | }
79 | }
80 | return instance;
81 | }
82 |
83 | @Override
84 | public Socket createSocket() throws IOException {
85 | return factory.createSocket();
86 | }
87 |
88 | @Override
89 | public Socket createSocket(Socket socket, String host, int port, boolean autoClose)
90 | throws IOException, UnknownHostException {
91 | if (Build.VERSION.SDK_INT < 11) { // 3.0
92 | injectHostname(socket, host);
93 | }
94 |
95 | return factory.createSocket(socket, host, port, autoClose);
96 | }
97 |
98 | private void injectHostname(Socket socket, String host) {
99 | try {
100 | Field field = InetAddress.class.getDeclaredField("hostName");
101 | field.setAccessible(true);
102 | field.set(socket.getInetAddress(), host);
103 | } catch (Exception ignored) {
104 | }
105 | }
106 |
107 | public class TrustAllManager implements X509TrustManager {
108 |
109 | @Override
110 | public void checkClientTrusted(X509Certificate[] arg0, String arg1)
111 | throws CertificateException {
112 |
113 | }
114 |
115 | @Override
116 | public void checkServerTrusted(X509Certificate[] arg0, String arg1)
117 | throws CertificateException {
118 |
119 | }
120 |
121 | @Override
122 | public X509Certificate[] getAcceptedIssuers() {
123 | return null;
124 | }
125 | }
126 |
127 | }
--------------------------------------------------------------------------------
/src/com/gizwits/opensource/appkit/view/DotView.java:
--------------------------------------------------------------------------------
1 | package com.gizwits.opensource.appkit.view;
2 |
3 | import com.gizwits.opensource.smartlight.R;
4 |
5 | import android.content.Context;
6 | import android.graphics.Canvas;
7 | import android.graphics.Paint;
8 | import android.graphics.Paint.Style;
9 | import android.util.AttributeSet;
10 | import android.view.View;
11 |
12 | public class DotView extends View {
13 | private Paint p;
14 | private int width;
15 | private int height;
16 | private int dash;
17 |
18 | public DotView(Context context, AttributeSet attrs) {
19 | super(context, attrs);
20 | init(context);
21 | }
22 |
23 | public DotView(Context context) {
24 | super(context);
25 | init(context);
26 | }
27 | private void init(Context context){
28 | p = new Paint(Paint.ANTI_ALIAS_FLAG);
29 | p.setStyle(Style.FILL);
30 | p.setColor(context.getResources().getColor(R.color.line_gray));
31 |
32 | final float scale = context.getResources().getDisplayMetrics().density;
33 | dash=(int) (3 * scale + 0.5f);
34 | }
35 | @Override
36 | protected void onDraw(Canvas canvas) {
37 |
38 | if(width>10){
39 | for(int i=0;i command = new ConcurrentHashMap();
110 | command.put(KEY5_COUNTDOWN_MINUTE, mPick.getValue());
111 | command.put(KEY8_COUNTDOWN_ONOFF, true);
112 | device.write(command, sn);
113 | countDownMinute = mPick.getValue();
114 | isOpenDelaying = true;
115 | finish();
116 | }
117 |
118 | @Override
119 | protected void didReceiveData(GizWifiErrorCode result, GizWifiDevice device,
120 | ConcurrentHashMap dataMap, int sn) {
121 | super.didReceiveData(result, device, dataMap, sn);
122 | if (result == GizWifiErrorCode.GIZ_SDK_SUCCESS) {
123 | deviceDataMap = dataMap;
124 | getDataFromDateMap();
125 | }
126 | }
127 |
128 | }
129 |
--------------------------------------------------------------------------------
/src/com/gizwits/opensource/devicecontrol/ui/activity/GosScheduleEditActionAcitvity.java:
--------------------------------------------------------------------------------
1 | package com.gizwits.opensource.devicecontrol.ui.activity;
2 |
3 | import java.util.ArrayList;
4 |
5 | import com.gizwits.opensource.smartlight.R;
6 | import com.gizwits.opensource.devicecontrol.ui.adapter.GosScheduleCheckBoxListAdapter;
7 | import com.gizwits.opensource.devicecontrol.ui.adapter.GosScheduleCheckBoxListDateHolder;
8 |
9 | import android.content.Intent;
10 | import android.os.Bundle;
11 | import android.os.Handler;
12 | import android.view.KeyEvent;
13 | import android.view.View;
14 | import android.view.View.OnClickListener;
15 | import android.widget.AdapterView;
16 | import android.widget.AdapterView.OnItemClickListener;
17 | import android.widget.ListView;
18 | import android.widget.TextView;
19 |
20 | public class GosScheduleEditActionAcitvity extends GosDeviceControlModuleBaseActivity implements OnClickListener {
21 |
22 | private TextView tvBack;
23 | private ListView lvAction;
24 | private ArrayList actionDates;
25 |
26 | @Override
27 | protected void onCreate(Bundle savedInstanceState) {
28 | super.onCreate(savedInstanceState);
29 | setContentView(R.layout.activity_comd_schedule_edit_action);
30 | initDate();
31 | initView();
32 | initEvent();
33 | }
34 |
35 | @Override
36 | public boolean onKeyDown(int keyCode, KeyEvent event) {
37 | if (keyCode == KeyEvent.KEYCODE_BACK) {
38 | setResult(RESULT_OK, null);
39 | finish();
40 | }
41 | return false;
42 | }
43 |
44 | private void initEvent() {
45 | tvBack.setOnClickListener(this);
46 | final GosScheduleCheckBoxListAdapter mAdapter = new GosScheduleCheckBoxListAdapter(this, actionDates);
47 | lvAction.setAdapter(mAdapter);
48 | lvAction.setOnItemClickListener(new OnItemClickListener() {
49 |
50 | @Override
51 | public void onItemClick(AdapterView> parent, View view, int position, long id) {
52 | for (GosScheduleCheckBoxListDateHolder date : actionDates) {
53 | date.checked = false;
54 | }
55 | actionDates.get(position).checked = true;
56 | mAdapter.notifyDataSetChanged();
57 | Handler handler = new Handler();
58 | final Intent intent = new Intent();
59 | if (position == 0) {
60 | intent.putExtra("action", true);
61 | } else {
62 | intent.putExtra("action", false);
63 | }
64 | handler.postDelayed(new Runnable() {
65 |
66 | @Override
67 | public void run() {
68 | setResult(RESULT_OK, intent);
69 | finish();
70 | }
71 | }, 100);
72 |
73 | }
74 | });
75 | }
76 |
77 | private void initView() {
78 | tvBack = (TextView) findViewById(R.id.tv_back);
79 | lvAction = (ListView) findViewById(R.id.lv_action);
80 | }
81 |
82 | private void initDate() {
83 | actionDates = new ArrayList();
84 | GosScheduleCheckBoxListDateHolder open = new GosScheduleCheckBoxListDateHolder(
85 | getResources().getString(R.string.apm_status_open), false);
86 | GosScheduleCheckBoxListDateHolder close = new GosScheduleCheckBoxListDateHolder(
87 | getResources().getString(R.string.apm_status_close), false);
88 | if (getIntent().getExtras().getBoolean("action", false)) {
89 | open.checked = true;
90 | close.checked = false;
91 | } else {
92 | open.checked = false;
93 | close.checked = true;
94 | }
95 | actionDates.add(open);
96 | actionDates.add(close);
97 | }
98 |
99 | @Override
100 | public void onClick(View v) {
101 | switch (v.getId()) {
102 | case R.id.tv_back:
103 | setResult(RESULT_OK, null);
104 | finish();
105 | break;
106 |
107 | default:
108 | break;
109 | }
110 |
111 | }
112 |
113 | }
114 |
--------------------------------------------------------------------------------
/src/com/gizwits/opensource/devicecontrol/ui/adapter/GosScheduleCheckBoxListAdapter.java:
--------------------------------------------------------------------------------
1 | /**
2 | *
3 | */
4 | package com.gizwits.opensource.devicecontrol.ui.adapter;
5 |
6 | import java.util.ArrayList;
7 |
8 | import com.gizwits.opensource.smartlight.R;
9 |
10 | import android.content.Context;
11 | import android.view.LayoutInflater;
12 | import android.view.View;
13 | import android.view.ViewGroup;
14 | import android.widget.BaseAdapter;
15 | import android.widget.CheckBox;
16 | import android.widget.TextView;
17 |
18 | /**
19 | * @author Administrator
20 | *
21 | */
22 | public class GosScheduleCheckBoxListAdapter extends BaseAdapter {
23 |
24 | ArrayList items;
25 | private LayoutInflater mInflater;
26 |
27 | public GosScheduleCheckBoxListAdapter(Context context, ArrayList items) {
28 | super();
29 | this.items = items;
30 | mInflater = LayoutInflater.from(context);
31 | }
32 |
33 | @Override
34 | public int getCount() {
35 | return items.size();
36 | }
37 |
38 | @Override
39 | public Object getItem(int position) {
40 | // TODO Auto-generated method stub
41 | return items.get(position);
42 | }
43 |
44 | @Override
45 | public long getItemId(int position) {
46 | return position;
47 | }
48 |
49 | @Override
50 | public View getView(int position, View convertView, ViewGroup parent) {
51 | View view;
52 | if (convertView == null) {
53 | view = mInflater.inflate(R.layout.item_comd_listview_with_checkbox, null);
54 | } else {
55 | view = convertView;
56 | }
57 | TextView itemName = (TextView) view.findViewById(R.id.tv_item);
58 | CheckBox checkBox = (CheckBox) view.findViewById(R.id.cb_date);
59 | itemName.setText(items.get(position).itemName);
60 | checkBox.setChecked(items.get(position).checked);
61 | return view;
62 | }
63 |
64 | }
65 |
--------------------------------------------------------------------------------
/src/com/gizwits/opensource/devicecontrol/ui/adapter/GosScheduleCheckBoxListDateHolder.java:
--------------------------------------------------------------------------------
1 | /**
2 | *
3 | */
4 | package com.gizwits.opensource.devicecontrol.ui.adapter;
5 |
6 | /**
7 | * @author Administrator
8 | *
9 | */
10 | public class GosScheduleCheckBoxListDateHolder {
11 |
12 | public String itemName;
13 | public boolean checked;
14 |
15 | /**
16 | * @param itemName
17 | * @param checked
18 | */
19 | public GosScheduleCheckBoxListDateHolder(String itemName, boolean checked) {
20 | super();
21 | this.itemName = itemName;
22 | this.checked = checked;
23 | }
24 |
25 | }
26 |
--------------------------------------------------------------------------------
/src/com/gizwits/opensource/devicecontrol/ui/adapter/GosScheduleListAdapter.java:
--------------------------------------------------------------------------------
1 | /**
2 | *
3 | */
4 | package com.gizwits.opensource.devicecontrol.ui.adapter;
5 |
6 | import java.util.List;
7 |
8 | import com.gizwits.opensource.smartlight.R;
9 | import com.gizwits.opensource.devicecontrol.date.GosScheduleData;
10 |
11 | import android.content.Context;
12 | import android.view.LayoutInflater;
13 | import android.view.View;
14 | import android.view.ViewGroup;
15 | import android.view.View.OnClickListener;
16 | import android.widget.BaseAdapter;
17 | import android.widget.Button;
18 | import android.widget.RelativeLayout;
19 | import android.widget.TextView;
20 |
21 | /**
22 | * @author Administrator
23 | *
24 | */
25 | public class GosScheduleListAdapter extends BaseAdapter {
26 | private Context context;
27 |
28 | public interface ToggleButtonClickListener {
29 | public void onclick(View v);
30 | }
31 |
32 | public interface DeleteButtonClickListener {
33 | public void onclick(View v);
34 | }
35 |
36 | private List mList;
37 | private LayoutInflater mInflater;
38 | private DeleteButtonClickListener deleteListener;
39 | private ToggleButtonClickListener toggleListener;
40 |
41 | /**
42 | * @param mList
43 | * @param mContext
44 | */
45 | public GosScheduleListAdapter(List list, Context context, ToggleButtonClickListener toggleListener,
46 | DeleteButtonClickListener deleteListener) {
47 | mList = list;
48 | this.deleteListener = deleteListener;
49 | this.toggleListener = toggleListener;
50 | this.context = context;
51 | mInflater = LayoutInflater.from(context);
52 | }
53 |
54 | public void setmList(List mList) {
55 | this.mList = mList;
56 | }
57 |
58 | @Override
59 | public int getCount() {
60 | return mList.size();
61 | }
62 |
63 | @Override
64 | public Object getItem(int position) {
65 | return mList.get(position);
66 | }
67 |
68 | @Override
69 | public long getItemId(int position) {
70 | return position;
71 | }
72 |
73 | @Override
74 | public View getView(int position, View convertView, ViewGroup parent) {
75 | GosScheduleViewHolder holder = null;
76 | if (convertView == null) {
77 | convertView = mInflater.inflate(R.layout.item_comd_schedule_list, null);
78 | holder = new GosScheduleViewHolder();
79 | holder.tvStatus = (TextView) convertView.findViewById(R.id.tv_status);
80 | holder.tvTime = (TextView) convertView.findViewById(R.id.tv_time);
81 | holder.tvDate = (TextView) convertView.findViewById(R.id.tv_date);
82 | holder.btnChecked = (Button) convertView.findViewById(R.id.btn_checked);
83 | holder.rlDelete = (RelativeLayout) convertView.findViewById(R.id.delete2);
84 | convertView.setTag(holder);
85 | } else {
86 |
87 | holder = (GosScheduleViewHolder) convertView.getTag();
88 | }
89 |
90 | holder.tvStatus.setText(mList.get(position).getTvStatus());
91 | holder.tvTime.setText(mList.get(position).getTvTime());
92 | holder.tvDate.setText(mList.get(position).getTvDateOrRepeat());
93 | holder.btnChecked.setSelected(mList.get(position).getBtnIsOpen());
94 | if (holder.btnChecked.isSelected()) {
95 | holder.tvStatus.setTextColor(context.getResources().getColor(R.color.text_black));
96 | holder.tvTime.setTextColor(context.getResources().getColor(R.color.text_black));
97 | holder.tvDate.setTextColor(context.getResources().getColor(R.color.text_black));
98 | } else {
99 | holder.tvStatus.setTextColor(context.getResources().getColor(R.color.text_gray));
100 | holder.tvTime.setTextColor(context.getResources().getColor(R.color.text_gray));
101 | holder.tvDate.setTextColor(context.getResources().getColor(R.color.text_gray));
102 | }
103 | holder.btnChecked.setTag(position);
104 | holder.btnChecked.setOnClickListener(new OnClickListener() {
105 |
106 | @Override
107 | public void onClick(View v) {
108 | toggleListener.onclick(v);
109 |
110 | }
111 | });
112 | holder.rlDelete.setTag(position);
113 | holder.rlDelete.setOnClickListener(new OnClickListener() {
114 | @Override
115 | public void onClick(View v) {
116 | deleteListener.onclick(v);
117 | }
118 | });
119 | return convertView;
120 | }
121 |
122 | }
123 |
--------------------------------------------------------------------------------
/src/com/gizwits/opensource/devicecontrol/ui/adapter/GosScheduleViewHolder.java:
--------------------------------------------------------------------------------
1 | /**
2 | *
3 | */
4 | package com.gizwits.opensource.devicecontrol.ui.adapter;
5 |
6 | import android.widget.Button;
7 | import android.widget.RelativeLayout;
8 | import android.widget.TextView;
9 |
10 | /**
11 | * @author Administrator
12 | *
13 | */
14 | public class GosScheduleViewHolder {
15 | public TextView tvStatus;
16 | public TextView tvTime;
17 | public TextView tvDate;
18 | public Button btnChecked;
19 | public RelativeLayout rlDelete;
20 | }
21 |
--------------------------------------------------------------------------------
/src/com/gizwits/opensource/devicecontrol/ui/utils/DensityUtils.java:
--------------------------------------------------------------------------------
1 | package com.gizwits.opensource.devicecontrol.ui.utils;
2 |
3 | import android.content.Context;
4 | import android.util.TypedValue;
5 |
6 | public class DensityUtils {
7 |
8 |
9 | /**
10 | * dp转px
11 | *
12 | * @param context
13 | * 上下文
14 | * @param dpVal
15 | * dp值
16 | * @return px值
17 | *
18 | * */
19 | public static int dp2px(Context context, float dpVal)
20 | {
21 | return (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP,
22 | dpVal, context.getResources().getDisplayMetrics());
23 | }
24 |
25 | /**
26 | * sp转px
27 | *
28 | * @param context
29 | * 上下文
30 | * @param spVal
31 | * sp值
32 | * @return px值
33 | *
34 | * */
35 | public static int sp2px(Context context, float spVal)
36 | {
37 | return (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_SP,
38 | spVal, context.getResources().getDisplayMetrics());
39 | }
40 |
41 | /**
42 | * px转dp
43 | *
44 | * @param context
45 | * 上下文
46 | * @param pxVal
47 | * px值
48 | * @return dp值
49 | *
50 | * */
51 | public static float px2dp(Context context, float pxVal)
52 | {
53 | final float scale = context.getResources().getDisplayMetrics().density;
54 | return (pxVal / scale);
55 | }
56 |
57 | /**
58 | * px转sp
59 | *
60 | * @param context
61 | * 上下文
62 | * @param pxVal
63 | * px值
64 | * @return sp值
65 | *
66 | * */
67 | public static float px2sp(Context context, float pxVal)
68 | {
69 | return (pxVal / context.getResources().getDisplayMetrics().scaledDensity);
70 | }
71 |
72 |
73 |
74 | }
75 |
--------------------------------------------------------------------------------
/src/zxing/camera/PreviewCallback.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2010 ZXing authors
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package zxing.camera;
18 |
19 | import android.graphics.Point;
20 | import android.hardware.Camera;
21 | import android.os.Handler;
22 | import android.os.Message;
23 | import android.util.Log;
24 |
25 | public class PreviewCallback implements Camera.PreviewCallback {
26 |
27 | private static final String TAG = PreviewCallback.class.getSimpleName();
28 |
29 | private final CameraConfigurationManager configManager;
30 | private Handler previewHandler;
31 | private int previewMessage;
32 |
33 | public PreviewCallback(CameraConfigurationManager configManager) {
34 | this.configManager = configManager;
35 | }
36 |
37 | public void setHandler(Handler previewHandler, int previewMessage) {
38 | this.previewHandler = previewHandler;
39 | this.previewMessage = previewMessage;
40 | }
41 |
42 | @Override
43 | public void onPreviewFrame(byte[] data, Camera camera) {
44 | Point cameraResolution = configManager.getCameraResolution();
45 | Handler thePreviewHandler = previewHandler;
46 | if (cameraResolution != null && thePreviewHandler != null) {
47 | Message message = thePreviewHandler.obtainMessage(previewMessage, cameraResolution.x, cameraResolution.y,
48 | data);
49 | message.sendToTarget();
50 | previewHandler = null;
51 | } else {
52 | Log.d(TAG, "Got preview callback, but no handler or resolution available");
53 | }
54 | }
55 |
56 | }
57 |
--------------------------------------------------------------------------------
/src/zxing/camera/open/OpenCameraInterface.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2012 ZXing authors
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package zxing.camera.open;
18 |
19 | import android.hardware.Camera;
20 | import android.util.Log;
21 |
22 | public class OpenCameraInterface {
23 |
24 | private static final String TAG = OpenCameraInterface.class.getName();
25 |
26 | /**
27 | * Opens the requested camera with {@link Camera#open(int)}, if one exists.
28 | *
29 | * @param cameraId
30 | * camera ID of the camera to use. A negative value means
31 | * "no preference"
32 | * @return handle to {@link Camera} that was opened
33 | */
34 | public static Camera open(int cameraId) {
35 |
36 | int numCameras = Camera.getNumberOfCameras();
37 | if (numCameras == 0) {
38 | Log.w(TAG, "No cameras!");
39 | return null;
40 | }
41 |
42 | boolean explicitRequest = cameraId >= 0;
43 |
44 | if (!explicitRequest) {
45 | // Select a camera if no explicit camera requested
46 | int index = 0;
47 | while (index < numCameras) {
48 | Camera.CameraInfo cameraInfo = new Camera.CameraInfo();
49 | Camera.getCameraInfo(index, cameraInfo);
50 | if (cameraInfo.facing == Camera.CameraInfo.CAMERA_FACING_BACK) {
51 | break;
52 | }
53 | index++;
54 | }
55 |
56 | cameraId = index;
57 | }
58 |
59 | Camera camera;
60 | if (cameraId < numCameras) {
61 | Log.i(TAG, "Opening camera #" + cameraId);
62 | camera = Camera.open(cameraId);
63 | } else {
64 | if (explicitRequest) {
65 | Log.w(TAG, "Requested camera does not exist: " + cameraId);
66 | camera = null;
67 | } else {
68 | Log.i(TAG, "No camera facing back; returning camera #0");
69 | camera = Camera.open(0);
70 | }
71 | }
72 |
73 | return camera;
74 | }
75 |
76 | /**
77 | * Opens a rear-facing camera with {@link Camera#open(int)}, if one exists,
78 | * or opens camera 0.
79 | *
80 | * @return handle to {@link Camera} that was opened
81 | */
82 | public static Camera open() {
83 | return open(-1);
84 | }
85 |
86 | }
87 |
--------------------------------------------------------------------------------
/src/zxing/decoding/DecodeFormatManager.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2010 ZXing authors
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package zxing.decoding;
18 |
19 | import java.util.Collection;
20 | import java.util.EnumSet;
21 | import java.util.Set;
22 |
23 | import com.google.zxing.BarcodeFormat;
24 |
25 | public class DecodeFormatManager {
26 |
27 | // 1D解码
28 | private static final Set PRODUCT_FORMATS;
29 | private static final Set INDUSTRIAL_FORMATS;
30 | private static final Set ONE_D_FORMATS;
31 |
32 | // 二维码解码
33 | private static final Set QR_CODE_FORMATS;
34 |
35 | static {
36 | PRODUCT_FORMATS = EnumSet.of(BarcodeFormat.UPC_A, BarcodeFormat.UPC_E, BarcodeFormat.EAN_13, BarcodeFormat.EAN_8, BarcodeFormat.RSS_14, BarcodeFormat.RSS_EXPANDED);
37 | INDUSTRIAL_FORMATS = EnumSet.of(BarcodeFormat.CODE_39, BarcodeFormat.CODE_93, BarcodeFormat.CODE_128, BarcodeFormat.ITF, BarcodeFormat.CODABAR);
38 | ONE_D_FORMATS = EnumSet.copyOf(PRODUCT_FORMATS);
39 | ONE_D_FORMATS.addAll(INDUSTRIAL_FORMATS);
40 |
41 | QR_CODE_FORMATS = EnumSet.of(BarcodeFormat.QR_CODE);
42 | }
43 |
44 | public static Collection getQrCodeFormats() {
45 | return QR_CODE_FORMATS;
46 | }
47 |
48 | public static Collection getBarCodeFormats() {
49 | return ONE_D_FORMATS;
50 | }
51 | }
52 |
--------------------------------------------------------------------------------
/src/zxing/decoding/DecodeThread.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2008 ZXing authors
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package zxing.decoding;
18 |
19 | import java.util.ArrayList;
20 | import java.util.Collection;
21 | import java.util.EnumMap;
22 | import java.util.EnumSet;
23 | import java.util.Map;
24 | import java.util.concurrent.CountDownLatch;
25 | import zxing.CaptureActivity;
26 | import android.os.Handler;
27 | import android.os.Looper;
28 | import com.google.zxing.BarcodeFormat;
29 | import com.google.zxing.DecodeHintType;
30 |
31 | /**
32 | * This thread does all the heavy lifting of decoding the images.
33 | *
34 | * @author dswitkin@google.com (Daniel Switkin)
35 | */
36 | public class DecodeThread extends Thread {
37 |
38 | public static final String BARCODE_BITMAP = "barcode_bitmap";
39 |
40 | public static final int BARCODE_MODE = 0X100;
41 | public static final int QRCODE_MODE = 0X200;
42 | public static final int ALL_MODE = 0X300;
43 |
44 | private final CaptureActivity activity;
45 | private final Map hints;
46 | private Handler handler;
47 | private final CountDownLatch handlerInitLatch;
48 |
49 | public DecodeThread(CaptureActivity activity, int decodeMode) {
50 |
51 | this.activity = activity;
52 | handlerInitLatch = new CountDownLatch(1);
53 |
54 | hints = new EnumMap(DecodeHintType.class);
55 |
56 | Collection decodeFormats = new ArrayList();
57 | decodeFormats.addAll(EnumSet.of(BarcodeFormat.AZTEC));
58 | decodeFormats.addAll(EnumSet.of(BarcodeFormat.PDF_417));
59 |
60 | switch (decodeMode) {
61 | case BARCODE_MODE:
62 | decodeFormats.addAll(DecodeFormatManager.getBarCodeFormats());
63 | break;
64 |
65 | case QRCODE_MODE:
66 | decodeFormats.addAll(DecodeFormatManager.getQrCodeFormats());
67 | break;
68 |
69 | case ALL_MODE:
70 | decodeFormats.addAll(DecodeFormatManager.getBarCodeFormats());
71 | decodeFormats.addAll(DecodeFormatManager.getQrCodeFormats());
72 | break;
73 |
74 | default:
75 | break;
76 | }
77 |
78 | hints.put(DecodeHintType.POSSIBLE_FORMATS, decodeFormats);
79 | }
80 |
81 | public Handler getHandler() {
82 | try {
83 | handlerInitLatch.await();
84 | } catch (InterruptedException ie) {
85 | // continue?
86 | }
87 | return handler;
88 | }
89 |
90 | @Override
91 | public void run() {
92 | Looper.prepare();
93 | handler = new DecodeHandler(activity, hints);
94 | handlerInitLatch.countDown();
95 | Looper.loop();
96 | }
97 |
98 | }
99 |
--------------------------------------------------------------------------------
/src/zxing/utils/CaptureActivityHandler.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2008 ZXing authors
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package zxing.utils;
18 |
19 | import zxing.CaptureActivity;
20 | import zxing.camera.CameraManager;
21 | import zxing.decoding.DecodeThread;
22 | import android.app.Activity;
23 | import android.content.Intent;
24 | import android.os.Bundle;
25 | import android.os.Handler;
26 | import android.os.Message;
27 |
28 | import com.gizwits.opensource.smartlight.R;
29 | import com.google.zxing.Result;
30 |
31 | /**
32 | * This class handles all the messaging which comprises the state machine for
33 | * capture.
34 | *
35 | * @author dswitkin@google.com (Daniel Switkin)
36 | */
37 | public class CaptureActivityHandler extends Handler {
38 |
39 | private final CaptureActivity activity;
40 | private final DecodeThread decodeThread;
41 | private final CameraManager cameraManager;
42 | private State state;
43 |
44 | private enum State {
45 | PREVIEW, SUCCESS, DONE
46 | }
47 |
48 | public CaptureActivityHandler(CaptureActivity activity, CameraManager cameraManager, int decodeMode) {
49 | this.activity = activity;
50 | decodeThread = new DecodeThread(activity, decodeMode);
51 | decodeThread.start();
52 | state = State.SUCCESS;
53 |
54 | // Start ourselves capturing previews and decoding.
55 | this.cameraManager = cameraManager;
56 | cameraManager.startPreview();
57 | restartPreviewAndDecode();
58 | }
59 |
60 | @Override
61 | public void handleMessage(Message message) {
62 | switch (message.what) {
63 | case R.id.restart_preview:
64 | restartPreviewAndDecode();
65 | break;
66 | case R.id.decode_succeeded:
67 | state = State.SUCCESS;
68 | Bundle bundle = message.getData();
69 |
70 | activity.handleDecode((Result) message.obj, bundle);
71 | break;
72 | case R.id.decode_failed:
73 | // We're decoding as fast as possible, so when one decode fails,
74 | // start another.
75 | state = State.PREVIEW;
76 | cameraManager.requestPreviewFrame(decodeThread.getHandler(), R.id.decode);
77 | break;
78 | case R.id.return_scan_result:
79 | activity.setResult(Activity.RESULT_OK, (Intent) message.obj);
80 | activity.finish();
81 | break;
82 | }
83 | }
84 |
85 | public void quitSynchronously() {
86 | state = State.DONE;
87 | cameraManager.stopPreview();
88 | Message quit = Message.obtain(decodeThread.getHandler(), R.id.quit);
89 | quit.sendToTarget();
90 | try {
91 | // Wait at most half a second; should be enough time, and onPause()
92 | // will timeout quickly
93 | decodeThread.join(500L);
94 | } catch (InterruptedException e) {
95 | // continue
96 | }
97 |
98 | // Be absolutely sure we don't send any queued up messages
99 | removeMessages(R.id.decode_succeeded);
100 | removeMessages(R.id.decode_failed);
101 | }
102 |
103 | private void restartPreviewAndDecode() {
104 | if (state == State.SUCCESS) {
105 | state = State.PREVIEW;
106 | cameraManager.requestPreviewFrame(decodeThread.getHandler(), R.id.decode);
107 | }
108 | }
109 |
110 | }
111 |
--------------------------------------------------------------------------------
/src/zxing/utils/InactivityTimer.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2010 ZXing authors
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package zxing.utils;
18 |
19 | import android.annotation.SuppressLint;
20 | import android.app.Activity;
21 | import android.content.BroadcastReceiver;
22 | import android.content.Context;
23 | import android.content.Intent;
24 | import android.content.IntentFilter;
25 | import android.os.AsyncTask;
26 | import android.os.BatteryManager;
27 | import android.os.Build;
28 | import android.util.Log;
29 |
30 | /**
31 | * Finishes an activity after a period of inactivity if the device is on battery
32 | * power.
33 | */
34 | public class InactivityTimer {
35 |
36 | private static final String TAG = InactivityTimer.class.getSimpleName();
37 |
38 | private static final long INACTIVITY_DELAY_MS = 5 * 60 * 1000L;
39 |
40 | private Activity activity;
41 | private BroadcastReceiver powerStatusReceiver;
42 | private boolean registered;
43 | private AsyncTask