提交 e6f2407f 编写于 作者: 奶油话梅糖's avatar 奶油话梅糖 🎨

删除边栏

上级 741d991d
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="gen"/>
<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
<classpathentry kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
<classpathentry kind="output" path="bin/classes"/>
</classpath>
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>DKLauncherDemo</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>com.android.ide.eclipse.adt.ResourceManagerBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>com.android.ide.eclipse.adt.PreCompilerBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>com.android.ide.eclipse.adt.ApkBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>com.android.ide.eclipse.adt.AndroidNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
eclipse.preferences.version=1
encoding//src/com/example/dklauncherdemo/MainActivity.java=UTF-8
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
org.eclipse.jdt.core.compiler.compliance=1.6
org.eclipse.jdt.core.compiler.source=1.6
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.dklauncherdemo"
android:versionCode="1"
android:versionName="1.0" >
<!-- 当前最高最低版本 -->
<uses-sdk
android:minSdkVersion="14"
android:targetSdkVersion="17" />
<!-- 程序自启动权限 -->
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<!-- 网络状态权限 -->
<uses-permission android:name="android.permission.INTERNET" />
<!-- 获取WiFi状态 -->
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<!-- 获取网络状态改变的权限 -->
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name="com.example.dklauncherdemo.MainActivity"
android:label="@string/app_name"
android:launchMode="singleTop"
android:theme="@android:style/Theme.Holo.Light.NoActionBar.Fullscreen" >
<intent-filter>
<category android:name="android.intent.category.HOME" />
<category android:name="android.intent.category.DEFAULT" />
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="com.example.dklauncherdemo.UnInstallActivity"
android:label="@string/app_name"
android:theme="@android:style/Theme.Holo.Light.Dialog.NoActionBar" >
</activity>
<!-- 程序开机自启动广播 -->
<receiver
android:name=".MyReceiver"
android:enabled="true"
android:exported="true" >
<intent-filter android:priority="1000" >
<action android:name="android.intent.action.BOOT_COMPLETED" />
</intent-filter>
</receiver>
</application>
</manifest>
\ No newline at end of file
# To enable ProGuard in your project, edit project.properties
# to define the proguard.config property as described in that file.
#
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in ${sdk.dir}/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the ProGuard
# include property in project.properties.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# Add any project specific keep options here:
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
# This file is automatically generated by Android Tools.
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
#
# This file must be checked in Version Control Systems.
#
# To customize properties used by the Ant build system edit
# "ant.properties", and override values to adapt the script to your
# project structure.
#
# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
# Project target.
target=android-17
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" >
<corners android:radius="25sp" />
<size
android:height="40sp"
android:width="100sp" />
<stroke
android:width="1sp"
android:color="#000" />
<solid android:color="#FFF" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" >
<corners android:radius="25sp" />
<size
android:height="100sp"
android:width="100sp" />
<stroke
android:width="1sp"
android:color="#000" />
<solid android:color="#FFF" />
</shape>
\ No newline at end of file
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="@+id/linearLayout2"
android:layout_alignLeft="@+id/linearLayout2"
android:layout_below="@+id/view2"
android:layout_weight="1" >
<GridView
android:id="@+id/gridView1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="10sp"
android:horizontalSpacing="10dp"
android:numColumns="5"
android:verticalSpacing="10dp" >
</GridView>
</LinearLayout>
<View
android:id="@+id/view1"
android:layout_width="2sp"
android:layout_height="match_parent"
android:layout_alignParentTop="true"
android:background="#000" />
<View
android:id="@+id/view2"
android:layout_width="match_parent"
android:layout_height="2sp"
android:layout_alignLeft="@+id/view1"
android:layout_alignParentRight="true"
android:layout_below="@+id/tv_user_id"
android:background="#000" />
<LinearLayout
android:id="@+id/linearLayout2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_toRightOf="@+id/view1"
android:orientation="horizontal" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="horizontal" >
<TextView
android:id="@+id/TextView01"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="5sp"
android:text="WIFI:"
android:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
android:id="@+id/tv_wifi_state"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="5sp"
android:ellipsize="marquee"
android:focusable="true"
android:focusableInTouchMode="true"
android:marqueeRepeatLimit="marquee_forever"
android:singleLine="true"
android:text="未连接"
android:textAppearance="?android:attr/textAppearanceMedium" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="right|center_vertical|center_horizontal"
android:orientation="horizontal" >
<TextView
android:id="@+id/tv_now_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="5sp"
android:text="Loading Time..."
android:textAppearance="?android:attr/textAppearanceMedium" />
</LinearLayout>
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="2sp"
android:layout_above="@+id/linearLayout2"
android:layout_alignParentRight="true"
android:background="#000" />
<View
android:id="@+id/View01"
android:layout_width="2sp"
android:layout_height="match_parent"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:background="#000" />
<TextView
android:id="@+id/tv_user_id"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_margin="5sp"
android:text="我的多看电纸书"
android:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
android:id="@+id/tv_batterLevel"
android:layout_width="70sp"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:layout_margin="5sp"
android:text="100% +"
android:textAppearance="?android:attr/textAppearanceMedium" />
<View
android:layout_width="match_parent"
android:layout_height="2sp"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:background="#000" />
<View
android:layout_width="match_parent"
android:layout_height="2sp"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:background="#000" />
</RelativeLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="200sp"
android:layout_height="200sp"
android:gravity="center_vertical|center_horizontal" >
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/linearLayout1"
android:layout_width="150sp"
android:layout_height="wrap_content"
android:gravity="center_vertical|center_horizontal"
android:orientation="vertical" >
<Button
android:id="@+id/btn_uninstall_con"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="5sp"
android:background="@drawable/shaper_apks_button_window_show"
android:text="卸载" />
<Button
android:id="@+id/btn_uninstall_cls"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="5sp"
android:background="@drawable/shaper_apks_button_window_show"
android:text="关闭" />
</LinearLayout>
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent" >
<LinearLayout
android:id="@+id/line_apps"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center_vertical|center_horizontal"
android:orientation="vertical" >
<ImageView
android:id="@+id/iv"
android:layout_width="50sp"
android:layout_height="50sp"
android:layout_margin="5dp"
android:maxHeight="40sp" />
<TextView
android:id="@+id/tv"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="5dp"
android:gravity="center"
android:maxLines="1"
android:text="Lable"
android:textColor="#000"
android:textSize="15sp" />
</LinearLayout>
</RelativeLayout>
</RelativeLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<EditText
android:id="@+id/et_title_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ems="10"
android:textColor="#000" >
<requestFocus />
</EditText>
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
</LinearLayout>
\ No newline at end of file
<menu xmlns:android="http://schemas.android.com/apk/res/android" >
<item
android:id="@+id/menu_settings"
android:orderInCategory="100"
android:showAsAction="never"
android:title="@string/menu_settings"/>
</menu>
\ No newline at end of file
<resources>
<!--
Base application theme for API 11+. This theme completely replaces
AppBaseTheme from res/values/styles.xml on API 11+ devices.
-->
<style name="AppBaseTheme" parent="android:Theme.Holo.Light">
<!-- API 11 theme customizations can go here. -->
</style>
</resources>
\ No newline at end of file
<resources>
<!--
Base application theme for API 14+. This theme completely replaces
AppBaseTheme from BOTH res/values/styles.xml and
res/values-v11/styles.xml on API 14+ devices.
-->
<style name="AppBaseTheme" parent="android:Theme.Holo.Light.DarkActionBar">
<!-- API 14 theme customizations can go here. -->
</style>
</resources>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">DKLauncherDemo</string>
<string name="hello_world">Hello world!</string>
<string name="menu_settings">Settings</string>
</resources>
\ No newline at end of file
<resources>
<!--
Base application theme, dependent on API level. This theme is replaced
by AppBaseTheme from res/values-vXX/styles.xml on newer devices.
-->
<style name="AppBaseTheme" parent="android:Theme.Light">
<!--
Theme customizations available in newer API levels can go in
res/values-vXX/styles.xml, while customizations related to
backward-compatibility can go here.
-->
</style>
<!-- Application theme. -->
<style name="AppTheme" parent="AppBaseTheme">
<!-- All customizations that are NOT specific to a particular API-level can go here. -->
</style>
</resources>
\ No newline at end of file
package com.example.dklauncherdemo;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.List;
import android.app.Activity;
import android.app.AlertDialog;
import android.content.BroadcastReceiver;
import android.content.ContentResolver;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.IntentFilter;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.net.wifi.WifiInfo;
import android.net.wifi.WifiManager;
import android.os.BatteryManager;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.provider.Settings;
import android.provider.Settings.SettingNotFoundException;
import android.util.Log;
import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.Window;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemLongClickListener;
import android.widget.EditText;
import android.widget.GridView;
import android.widget.ImageView;
import android.widget.TextView;
import com.example.dklauncherdemo.adapter.DeskTopGridViewBaseAdapter;
import com.example.dklauncherdemo.adapter.GetApps;
import com.example.dklauncherdemo.mysql.MyDataBaseHelper;
import com.example.dklauncherdemo.util.AppInfo;
/**
* @author Administrator
* @year 2019
* @Todo TODO 桌面主页
* @package_name com.example.dklauncherdemo
* @project_name DKLauncherDemo
* @file_name MainActivity.java
* @我的博客 https://naiyouhuameitang.club/
*/
public class MainActivity extends Activity implements OnClickListener {
private TextView batterLevel;
private BroadcastReceiver batteryLevelRcvr;
private IntentFilter batteryLevelFilter;
private Handler handler;
private Runnable runnable;
private TextView tv_user_id;
private TextView tv_now_time;
private TextView tv_wifi_state;
static GridView mGridView;
static List<AppInfo> appInfos = new ArrayList<AppInfo>();
public static String string_app_info;
private MyDataBaseHelper dbHelper;
private SQLiteDatabase db;
/**
* 备份一个GridView的写法
*
*
* <!-- android:numColumns="auto_fit" --------列数设置为自动 --> <!--
* android:columnWidth="90dp",----------每列的宽度,也就是Item的宽度 --> <!--
* android:stretchMode="columnWidth"------缩放与列宽大小同步 --> <!--
* android:verticalSpacing="10dp"----------垂直边距 --> <!--
* android:horizontalSpacing="10dp"-------水平边距 -->
*
* @param savedInstanceState
*/
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);// 无Title
setContentView(R.layout.activity_main);
System.out.println("你好,世界");
initView();// 绑定控件
new_time_Thread();// 启用更新时间进程
monitorBatteryState();// 监听电池信息
rember_name();// 记住昵称
get_wifi_server();// 获取WIFI状态