我正在制作一个Android应用程序,用于测试手机上的某些安全功能是否已启用.例如,如果您启用了密码登录,或者您的手机上的数据已加密.
出于某种原因,应用程序必须运行两次才能测试并查看是否在手机上启用了这些安全功能,这是我正在尝试解决的问题.我希望它能够测试并查看在创建应用程序时以及第一次运行应用程序时是否启用了安全功能,而不是第二次运行应用程序.
我测试onStart()我的MainActivity文件中的函数是否启用了这些功能.我在下面列出了函数代码:
@Override
@TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR1)
@SuppressLint("NewApi")
public void onStart()
{
super.onStart();
//determine if phone uses lock pattern
//It returns 1 if pattern lock enabled and 0 if pin/password password enabled
ContentResolver cr = getBaseContext().getContentResolver();
lockPatternEnable = Settings.Secure.getInt(cr, Settings.Secure.LOCK_PATTERN_ENABLED, 0);//Settings.System
//returns 1 if pin/password protected. 0 if not
KeyguardManager keyguardManager = (KeyguardManager) getBaseContext().getSystemService(Context.KEYGUARD_SERVICE);
if( keyguardManager.isKeyguardSecure())
{
//it is pin or password protected
pinPasswordEnable=1;
}
else
{
//it is not pin or password protected
pinPasswordEnable=0;
}//http://stackoverflow.com/questions/6588969/device-password-in-android-is-existing-or-not/18716253#18716253
//determine if …Run Code Online (Sandbox Code Playgroud) 我已签名并压缩我的Android应用程序,现在希望将其上传到Play商店.但是,当我完成上传后,我收到以下消息:
上传失败您的APK包名称必须采用以下格式"com.example.myapp".它可能包含字母(az),数字和下划线(_).它必须以小写字符开头.它必须是150个字符或更少.
我的apk名是
dd.afm.aftermath.apk
所以我不明白为什么不遵守?
提前致谢