Android view Local Database __ Database

Source: Internet
Author: User
Tags sqlite sqlite database file permissions

Reprint please indicate the source, welcome to reprint. http://blog.csdn.net/robin_java/article/details/51536223

This podcast mainly wants to introduce you to me at that time when learning the SQLite database, cannot open the directory, cannot view the data table question. (No code logic, pure operation.) )

If you use a simulator, this problem will not normally occur. I ran into this problem because I (probably a lot of people) used the real machine. To search the Internet a variety of solutions, some say command line, and some say the re manager, anyway, I did not deal with it, finally suddenly a way to solve, and efficient. To share with you again.

This blog you will learn the following content:

1. Create a datasheet in your code how to view it.

2. File permissions, that rwx is what ghost.

3. I go to search how to view the SQLite database, how to the last step in the Fileexplore database permissions are all right, or export data table has problems. (usually in the console below the red log appears, in short, can not come out.) )

(statement, I use the development environment: Android studio2.1.1, test machine: Millet 4C, ROM version: MIUI7 6.5.26| Development version based on android5.1.1)


Get to the point. First of all, if you create a data table, whether you are using native SQLite or some tripartite libraries (such as xutils) are actually the same,

The first step: you want to open the Android Device Monitor below (the robot in the red box)


Step two: This is the following interface notice red box content


Step three: If your phone does not have a root,data directory will not open, hurry to root, how root. Third party chant, to root master, Brush Machine Wizard and so on. Perhaps the great God could not see such a third party, anyway, I was small white, use up feel good, here hint, with the root master, the root process is best not to unplug the data line , then Millet 4C just got the first day of the hand inserted directly, root, this time jammed, I pulled off the data line, directly can not boot, and then went to the sale, after the sale said, your first day of the new mobile phone will be sold after the sale is no one. A little gossip, then go on.

Step Fourth: This time if you find that your phone has root, but still can not open, why. Because you can look at the data file after the access rights drwxrwx--x, a little bit of knowledge of Linux know that the first is the file type, D is the directory, the back 9-bit divided into three groups, three-bit a group, the first group of permissions for the owner of the file, the second group of users permissions The third group is the permissions of other users. RWX is readable writable executable (-to indicate that there is no such permission), so now drwxrwx--x permission is not open the data directory, this time need a call called Re Manager artifact to modify file permissions, directly removed, this app must be root to normal use.

Fifth step: Re manager download Open the RE manager, find the following directory data, long Press pop-up a dialog, where you can modify the permissions of the directory, click the permissions set, directly changed to RWX (may be a bit long), the following figure


If this is not done for a long time, it is possible to manually modify only the directories that need to be modified, as in the same way. So the problem is, those catalogs need to be modified. Here is a normal open directory, that is data-->data--> (your project package name my is Com.robin.tiantianplayer)-->databases--> (your database name, Mine is Db_tiantianplayer). The directory you want to modify is the node in the previous path, and one of the changes is OK.

Sixth step: Focus on, select the database, click on the export icon in the upper right corner

Choose to export there, excited to click OK, and then ready to find the PC side of Third-party tools to view the database, and so long, my database. Export it again, WTF.


(may be do not have to complain, anyway is the problem of exporting)

What the hell is this? Sad extremely, this time I suddenly thought of a method, can see the database on the mobile phone. Open the RE manager, along the path above the red path, this is to click on the database Behind the box, and then click on the file icon, as shown below






Did you find success after you finished?

Haha, need to refresh the database as long as return to open on it, in fact, this method I feel more than the computer export database in the view is also fast, really do not accidentally inserted Liu-shady ~ ~

Here is a mouth, every app in the phone has clear cache, clear the data, here to say, clear the cache is it? The red path above the database in a folder called cache content to clear out, the general cache content will be placed here, Clearing the data clears all files under the Red Path Project package name path above. If you create a folder in your code that is in your memory card, it's none of your business to clear the data or uninstall the app, the folder you created will not be deleted.

Finally thank you, like please point praise, there are questions, you can reply to exchange, there are errors, please point out. Thx.

Reprint please indicate the source, welcome to reprint. http://blog.csdn.net/robin_java/article/details/51536223

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.