Android App
app_ex's Introduction
app_ex's People
app_ex's Issues
首次打开应用的向导页
使用 SharedPreferences 记录
ViewPager
写日志 到SD卡
6.0 需要运行 添加 权限申请
使用 com.github.hotchemi:permissionsdispatcher
读取 配置 信息
PackageManager packageManager = context.getPackageManager();
PackageInfo packageInfo;
try {
packageInfo = packageManager.getPackageInfo(context.getPackageName(), 0);
versionCode = packageInfo.versionCode + "";
} catch (PackageManager.NameNotFoundException e) {
}
Android 沉浸式状态栏的实现
Android 设备信息
先添加权限 Build 类 获取手机号码、IMEI码
<uses-permission android:name="android.permission.READ_PHONE_STATE"/>
IP MAC 地址 需要
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
MAC 地址 需要 权限
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
GPS 定位
全局 store 设置
- 使用Application 类
public class SessionApplication extends Application {
public static Context mContext;
public static User user;
@Override
public void onCreate() {
super.onCreate();
mContext = getApplicationContext();
getUserInfo();
}
public static User getUser() {
return user;
}
}
<?xml version="1.0" encoding="utf-8"?>
<manifest
<application
android:name=".SessionApplication"
</application>
</manifest>
局部使用
User user = SessionApplication.getUser();
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.