Android Knowledge Point Review

Source: Internet
Author: User

Interface file: http://ah2.zhangyue.com/zybook/u/p/book.php?key=4B4


Adb-s emulator-5554 Shell
Adb-s emulator-5554 Install D:\Android\android-sdk-windows\tools\tengxun.apk
D:\Android\android-sdk-windows\tools
D:\Android\android-sdk-windows\platform-tools


Put the class file in the same folder as Dex2jar.bat and drag it directly to Dex2jar.bat to get the class file compiled


Put the apk file inside the apktool-1.5.2-windows, and then enter the following directly in CMD, so you can get the XML compilation
C:\Users\admin\android-reverse-trinea\apktool1.5.2\apktool.bat D C:\Users\admin\android-reverse-trinea\ apktool1.5.2\ireader.apk C:\Users\admin\ireader

After the apktool-1.5.2-windows inside the apk deleted, to find the Weiguan1 folder and Apktool folder, the actual useless

Apktool D C:\Users\admin\android-reverse-trinea\apktool1.5.2\manhua.apk C:\Users\admin\manhua

C:\Users\admin\android-reverse-trinea\dex2jar-0.0.9.15\dex2jar.bat Classes.dex


Here is the command to install the emulator app

D: Enter

CD D:\Android\android-sdk-windows\tools

D:\ANDROID\ANDROID-SDK-WINDOWS\TOOLS\ADB Install D:\Android\android-sdk-windows\tools\ireader\ireader.apk



Sharedpreferences saved data as long as the key-value of the simple type
The Sharedpreferences interface is primarily responsible for reading the application's preferences data, and has the following methods to access Key-value pairs in sharedpreferences.
--"1.boolean contains (String key); Determines whether the sharedpreferences contains the data of the characteristic key.
--"2.abstract map<string,?> getAll (); Get all the key-value pairs in the sharedpreferences data.
--"3.boolean getXxx (String key, xxx defvalue); Gets the value,xxx of the specified key in the sharedpreferences can be boolean, float, int, long, A variety of basic types such as String.

The Sharedpreferences interface does not provide the ability to write to the data, but through the internal interface of the sharedpreferences, Sharedpreferences calls the edit () method to obtain its corresponding editor object. Editor provides the following methods to write data to sharedpreferences.
--"1.sharedpreferences.editor clear (); empties all data in Sharedpreferences.
--"2.sharedpreferences.editor putxxx (String key, xxx value);
--"3.sharedpreferences.editor Remove (String key); Deletes the data item corresponding to the specified key.
--"4.boolean commit (); When editor is finished, call the method to commit the modification.

The sharedpreferences itself is an interface, and the program cannot create the Sharedpreferences instance directly, only through the getsharedpreferences provided by the context (String name, int mode) method to get the Sharedpreferences instance, the second parameter of the method supports the following values:
Context.mode_private: Specifies that sharedpreferences data can only be read and written by this application.
Context.mode_world-readable: Specifies that the sharedpreferences data can be read by other applications, but cannot be written.
Context.mode_world_writeable: With anti-
Information storage location:


In case you forget--let it leave a trace.

1, run the input adb shell (if the emulator is running) Not enough permissions add: adb root
2, enter the command interface after entering the LS command will list the file directory
3. CD into the directory you want (data/data in the File Explorer in Eclipse can find the corresponding database file. For example: CD com.android.providers.contacts)
4, a layer of a layer will be found in the databases directory your data file is in this directory is decentralized (CONTACTS2.DB)
5, Sqlite3 Test (test is the name of the database you created note: Do not add. db suffix)
6. Now you have access to the test database you created. Tables can view all the tables;

ADB shell

1) Create the database file:
>sqlite3 D:\test.db Enter
A test.db is generated on the D-disk.
And SQLite3 hung up on this test.db.

2)
Use. Help to see what the orders are.
>.help Enter

3) You can enter the SQL statement directly here to create a table with; end, then enter to see

4) See how many tables have been created
>.tables

5) Look at the table structure
>.schema Table Name

6) Look at the currently hanging database
>.database

7) If you want to output the query to a file
>.output file name
> Query statements;
The query results are output to the file C:\query.txt
Use the screen output for query results
>.output stdout

8) Output The table structure, and the index will also output
. Dump Table Name

9) exit
>.exit or. Quit
Common SQL Operations, Common standard SQL statements.

%java_home%\bin;%java_home%\jre\bin;%systemroot%\system32;%systemroot%;%systemroot%\system32\wbem; C:\Program Files\tortoisesvn\bin

http://blog.csdn.net/hzc543806053/article/details/7627157

.; %android_sdk_home%\platform-tools;

.;D: \ Android\android-sdk-windows\platform-tools;i:\android\android-sdk-windows\tools

Sometimes you need to automatically prompt when editing an XML file in Eclipse just follow the steps below:

1. open Window--->preferences----->general------->keys

Find the content Assist in the view to change the corresponding value to:

Binding: Custom shortcut keys

When:editing in structured Text Editors

Click Apply, then finish, then edit in Eclipse, how, there is XML hint?? Oh!!


Today, I met a strange thing, I used to be in eclipse some Android XML file, there will be code automatically prompt input display, but now suddenly no, Java code hints also. The whole day is not clear except why ... Google down, it turns out that I opened the XML file in the wrong way, think about it, and then directly double-click and then select the XML view, today is the Open with-"XML editor."

Use open with->android layout Editor;


Using various controls in Android (View)

Installing the Tomcat plugin under Eclipse makes the development, compilation, and release of the software quite simple, so let's say the installation process is simple:
1. Download a Tomcat plugin first
Address: Http://www.eclipsetotale.com/tomcatPlugin/tomcatPluginV321.zip
2. After downloading, unzip the zip and extract the contents into the plugin directory under Eclipse.
3. In the links directory, create a new Tomcat.link file with the contents of the plugin Tomcat plugin directory as
F:\eclipse\plugins\com.sysdeo.eclipse.tomcat_3.2.1
4. After the configuration, open eclipse will appear the Tomcat small icon, and then configure the Tomcat in the Windows->preferences
So the completion of the plug-in process is over, is not very simple Ah, other plug-ins can also refer to the installation method


Java's StringBuffer class

Posted on 2009-12-03 16:42 light of Fire reading (56200) Comments (4) Edit Collection
The StringBuffer class, like String, is also used to represent strings, except that because the StringBuffer is implemented in a different way than string, the StringBuffer does not generate a new object when string processing occurs. The memory usage is superior to the string class.
So in the actual use, if you often need to modify a string, such as inserting, deleting and so on, use StringBuffer to be more appropriate.

There are many methods in the StringBuffer class that are the same as the string class, which are functionally identical to the functions in the string class.

One of the most notable differences, however, is that each modification of a StringBuffer object alters the object itself, which is the biggest difference from the string class.

In addition, because StringBuffer is thread-safe, the concept of threading is followed by specific chapters, so it can be easily used in multithreaded programs, but the execution efficiency of the program will be slightly slower.

1. Initialization of StringBuffer objects

The initialization of the StringBuffer object is not the same as the initialization of the string class, Java provides special syntax, and typically is initialized with a constructor method.
For example:
StringBuffer s = new StringBuffer ();
This initializes the StringBuffer object as an empty object.
If you need to create a StringBuffer object with content, you can use:
StringBuffer s = new StringBuffer ("abc");
The content of this initialized StringBuffer object is the string "abc".
It is important to note that StringBuffer and string are of different types and cannot be cast directly, and the following code is wrong:
StringBuffer s = "abc"; Assignment types do not match
StringBuffer s = (stringbuffer) "ABC"; There is no inheritance relationship and cannot be strongly turned
The code for the StringBuffer between the object and the string object is as follows:
String s = "abc";
StringBuffer sb1 = new StringBuffer ("123");
StringBuffer SB2 = new StringBuffer (s); Convert String to StringBuffer
String S1 = sb1.tostring (); StringBuffer Convert to String
2. Common methods of StringBuffer

The methods in the StringBuffer class mainly focus on changes to strings, such as Append, insert, and delete, which are the main differences between the StringBuffer and the string classes.
A, Append method
Public StringBuffer Append (Boolean B)
The function of this method is to append the content to the end of the current StringBuffer object, similar to a string connection. After the method is called, the contents of the StringBuffer object also change, for example:
StringBuffer sb = new StringBuffer ("abc");
Sb.append (TRUE);
The value of the object SB will become "Abctrue".
Using this method to concatenate strings will save more content than string, such as a connection applied to a database SQL statement, such as:
StringBuffer sb = new StringBuffer ();
String user = "Test";
String pwd = "123";
Sb.append ("select * from UserInfo where username=")
. Append (user)
. Append ("and pwd=")
. append (PWD);
The value of this object SB is the string "select * from UserInfo where username=test and pwd=123".
B, Deletecharat method
Public stringbuffer deletecharat (int index)
The function of this method is to delete the character at the specified position and then form the remaining content into a new string. For example:
StringBuffer sb = new StringBuffer ("Test");
SB. Deletecharat (1);
The function of the code is to delete the string object SB in the index value of 1 characters, that is, to delete the second character, the remaining content constitutes a new string. So the value of the object SB becomes "Tst".
There is also a function-like Delete method:
Public StringBuffer Delete (int start,int end)
The function of this method is to delete all characters within the specified interval, including the start, which does not contain the range of the end index value. For example:
StringBuffer sb = new StringBuffer ("teststring");
SB. Delete (1,4);
The purpose of the code is to remove all characters between the index value 1 (including) to the index value 4 (not included), and the remaining characters to form a new string. The value of the object SB is "Tstring".
C, Insert method

Public stringbuffer Insert (int offset, Boolean b)

The function of this method is to insert content into the StringBuffer object and then form a new string. For example:

StringBuffer sb = new StringBuffer ("teststring");

Sb.insert (4,false);

The purpose of the sample code is to insert a false value at the index value 4 of the object SB, to form a new string, then the value of the object SB after execution is "testfalsestring".
D, Reverse method

Public StringBuffer Reverse ()

The function of this method is to invert the contents of the StringBuffer object and then form a new string. For example:
StringBuffer sb = new StringBuffer ("abc");
Sb.reverse ();
After the reversal, the content in the object SB becomes "CBA".
E, Setcharat method

public void Setcharat (int index, char ch)

The function of this method is to modify the character of the index value in the object to be the new character Ch. For example:

StringBuffer sb = new StringBuffer ("abc");

Sb.setcharat (1, ' D ');

The value of the object SB will become "ADc".

F, TrimToSize method

public void TrimToSize ()

The purpose of this method is to reduce the space waste by narrowing the storage space of the StringBuffer object to the same length as the string length.
In short, in the actual use, string and stringbuffer each have advantages and disadvantages, according to the specific use of the environment, select the corresponding type to use.

DatePicker-Date Selection control
Timepicker-Time selection control
ToggleButton-double-state button control
EditText-Editable text controls
ProgressBar-progress bar control
SeekBar-Draggable Progress bar control
Autocompletetextview-Editable text control with auto-completion enabled
Multiautocompletetextview-Editable text control that supports AutoComplete, allowing multiple values to be entered (multiple values are automatically separated by the specified delimiter)
Zoomcontrols-Zoom In/Out button control
Include-Consolidation Controls
Videoview-Video playback controls
WebView-Browser Controls
Ratingbar-scoring controls
TAB-Tab control
Spinner-drop-down box control
Chronometer-Timer Control
ScrollView-scroll bar control
Layout used in Android

Framelayout: There can only be one control in it, and the position of the control cannot be designed, and the control will be placed in the upper left corner

LinearLayout: You can put multiple controls inside, but only one control on a line

Tablelayout: This is to be used in conjunction with TableRow, much like the table in HTML

Absolutelayout: You can put multiple controls inside, and you can define the location of the control's X, y

Relativelayout: You can put more than one control inside, but the position of the control is relative to the position

(The Android interface layout seems to have a direct reference to some view, such as ScrollView, etc.)


Baidu Network disk of Android Source:

4.2:

http://pan.baidu.com/share/link?shareid=1473383909&uk=2485945592

4.4:

http://blog.csdn.net/ilittleone/article/details/6823441

4.4:

Http://pan.baidu.com/s/1o6NQATW

4.4:

http://pan.baidu.com/share/link?shareid=601393575&uk=3506802583&fid=3272776380

Android Knowledge Point Review

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.