Android study note _ 61 _ mobile security guard knowledge points (1)

Source: Internet
Author: User
Tags myadmin

1. when automatically installing and updating a program, ensure that the program signature and package name are the same. c: \ Documents and Settings \ zehua \. android \ debug. keystore debug Signature: Re-installation failed due to different application signatures. please execute 'adb uninstall cn. itcast. mobilesafe 'in a shell.

2. Two context differences:

The applicationcontext life cycle process has a context and an activity exists. this activity exists in the context of the task stack. For example, when you open the database and input the context time, you must use the application context. Because if you use the activity context, it will not exist if it is recycled, and an error will occur, therefore, the pop-up box can only match the acitvity context. If it is global, the global context is used.

3. android: gravity and android: layout_gravity

="center"="right"

4. You need to specify the FLAG_ACTIVITY_NEW_TASK attribute:

If you start an activity in the broadcast receiver and service, you must explicitly specify the time because the broadcast receiver and service do not have a task stack.

5. Method of terminating broadcast:

You cannot use abortBroad because the call method to send a broadcast carries the receiver API. This method cannot be ended by abortBroad and must end with setResult.

6. Custom window:

View view = View.inflate(, R.layout.first_entry_dialog, = factory.inflate(resource, root);  

7. Use of status and shape graphics:

                                                                   

8. alignParentBottom:

 

9. activity switching:

OverridePendingTransition between activity Switches

10. Processing of a line:

    

11. GPS gadgets:

      MyLoactionListener listener;       (mGpsInfoProvider == = =            =        String provider =        manager.requestLocationUpdates(provider, 60000, 10        SharedPreferences sp = context.getSharedPreferences("config"= sp.getString("location", ""             (listener == =         MyLoactionListener  ="latitude "+ location.getLatitude();             String longtitude = "longtitude "+ location.getLongitude();             SharedPreferences sp = context.getSharedPreferences("config"="location", latitude+" - "+    onStatusChanged(String provider,       =  Criteria();         manager.getBestProvider(criteria, 

12. How to set an application as a device manager:

=  ComponentName(, MyAdmin. (mService !=  (!= 

 

21<receiver android:name=".MyAdmin">              <meta-data android:name="android.app.device_admin"="@xml/my_admin" />              <intent-filter>                  <action android:name="android.app.action.DEVICE_ADMIN_ENABLED" />              </intent-filter>          </receiver><?xml version="1.0" encoding="utf-8"?>  <device-admin xmlns:android="http://schemas.android.com/apk/res/android">          <uses-policies>                  <limit-password />                  <watch-login />                  <reset-password />                  <force-lock />                  <wipe-data />          </uses-policies>  </device-admin>    2= Class.forName("android.os.ServiceManager""getService", String.= (IBinder) method.invoke(=3=  ComponentName(, MyAdmin. (mService !=  (!= 

13. How to place Chinese source files in program development:

1234~100M~ 1G   

14. The UI cannot be changed by the sub-thread. Why can the Progress be updated continuously on the Progress?

     (Thread.currentThread() !=

15. ImageView:

In fact, ImageView is the same as DIV in HTML. In fact, all controls can be seen as DIV in HTML. You set SRC to fill in the portion shown inside it, so with the padding attribute, if you fill in the background, the whole is filled. The value of ScaleType represents the following meanings: ImageView is the basic Image Display Control in Android. This control has an important attribute: ScaleType, which is used to display images, A total of 8 values are ScaleType. CENTER: The image size is the original size. If the image size is greater than the ImageView control, the middle part of the image is taken. If the size is smaller than, the image is displayed in the CENTER. ScaleType. CENTER_CROP: scale the image proportionally, so that the shorter side of the image is the same as the length of the ImageView side, that is, no blank space is allowed. after scaling, the middle part is taken for display. ScaleType. CENTER_INSIDE: scale down the image size greater than ImageView until the entire image is displayed in the ImageView center. The image smaller than ImageView remains unchanged and is displayed in the center. ScaleType. FIT_CENTER: the default status of the ImageView. The scale of a large image is reduced, so that the entire image can be displayed in the middle of the ImageView. The scale of a small image is enlarged, and the entire image is displayed in the ImageView center. ScaleType. FIT_END: The scaling mode is the same as that of FIT_CENTER. The scaling mode only displays the image in the right or bottom, not in the center. ScaleType. FIT_START: The scaling mode is the same as that of FIT_CENTER. The scaling mode only displays the image on the left or top, not in the center. ScaleType. FIT_XY: scales the image proportionally to the same size as ImageView. Fill the entire ImageView. ScaleType. MATRIX: it is based on a 3x3 MATRIX to scale the image. Any View has a method called layout. Very easy to use. TV _drag_view.layout (TV _drag_view.getLeft (), 260, TV _drag_view.getRight (), 280android. widget. RelativeLayout. LayoutParams layoutParams =

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.