Copy sqlite db file from Android terminal to Windows OS - java

I want to copy the sqlite database from data/data/[package name]/databases/ to Windows Operating system.
Currently, I am inside Android Terminal shell of Android studio and my current path is /data/data/example.com.sensor/databases.
There is a sqlite file in this directory. The name is sensor.sqlite.
This is perhaps an easy question for experience user like you.
However, I have spent 2 hours yet I find the result.
Thank you.
Regards,
Jimmy

Since your device is not rooted, you cannot do this from outside of the application. If it's your application, you can add a temporary routine into the application to copy the database to public storage, then use adb or MTP to copy the file to your Windows computer.
Or, you can just root your device.

See below attached image.
* To pull any file(note here you can pull only file,not folder).
-> As you can see just select your device from Device tab (On left).
-> Then Goto File Explorer tab and find path of your database.
As in image you can see I have open database directory of com.android.browser package application.
If you got some problem of finding your app package there, See another screen-shot below.And find app as directed there.

Steps :
Open Android Device Monitor.
Make sure your device is online & if your device is online, you will see like this in left side (Available device). Choose your device & in the centre at File Explorer tab, you can see the db file exists. The path is data/data/Your-Application-package/databases/Your-db-file
In the right top side, click Pull once you selected your db file and save it with extension .sqlite.

Related

How to write files to your desktop with the use of an android application using an emulator or USB-connected device using for example Android Studio?

I wrote some classes for my Android-program and it runs. However it takes too much ram because the data in the File is not in a nice form to be processed by the application. Let's call the File Foo.txt for now.
I now want to save the data from Foo.txt in a different form which lets my Android specific code (specific in the sense that it uses Activities, Context etc) do easily since I have all the code for it already, and then load from this data manipulatedFooFile.txt instead. Problem is, I don't know if it's possible at all to save to a file which I can then later retrieve on the desktop, either in an emulator or via a device connected to an USB or a way I don't know of yet. This way I can replace Foo.txt with manipulatedFooFile.txt which would let me use less ram and space on disk.
I know that one other solution would be to remove the code from android and put it into a normal java program. Put that would take a bit of struggle since I have to remove all the dependencies on code that is not there, or start with nothing and write big parts of the code again.
Files and folders can be sent to and from your android device using adb (or android debug bridge).
Using the adb pull command under the syntax adb pull <remote> <local> you are able to transfer a file from the filesystem of the connected android device to your local device (your computer).
From the official documentation for adb pull:
Copies a specified file from an emulator/device instance to your development computer.
Similarly, adb push allows you to push a file from your local computer to the target emulator/android device under the syntax adb push <local> <remote>.

File Viewing code in XML (Samsung Galaxy Y)

I'm developing an android app to transfer files to a computer over a local area network.
I have finished the layout in XML, but one of my options is to open the files within the phone.
Does anyone know the code to view the files within my phone? or is there another way around it like using the default files application already installed on my phone?
I essentially need to be able to view the files so that the user can select which files need to be sent.
Does anyone know the solution to this?
Thanks a lot.

Access SQLite DB without the emulator?

I have been trying to pull out my SQLite database from my android application onto my computer.
I only get results, when I run my application on the eclipse android emulator and then I can access to the DB. But the thing is using the emulator is to slow and it doesn't have all the data I have been storing on my app on the cellphone.
I have been googling that for a day and all I can see is "use the emulator".
Isn't it possible without the emulator ?
On commercially released Android devices, you aren't allowed access to your app's internal SQLite database (for security reasons). Thus, if you simply can't stand the emulator, or if you just want to test your app on an actual device to make sure it works properly, there are two options to consider.
Root your device. This will give you access to the /data folder where your app's internal SQLite database is stored.
Use a 3rd party library to write the contents of your database to the SD card. This is a nice workaround if you don't want to bother rooting your device. Check this post for one such implementation.
The SQLite database in your app is just a file. You can use the DDMS file view in Eclipse to pull the file off your device, but only if you have a rooted or development device, or if you're using the emulator.
Once youve got the file on your computer you'll be able to run queries against it using the sqlite3 command (which, depending on your system, you may have to install).

blackberry eclipse show device folders

I am an android programmer but quite newbie using blackberry. How to show device folder structure if using eclipse BB SDK? same as File explorer of android SDK... Thank you
Blackberry project does not have anything like "device folder structure". There is a file explorer application on the device, that can help you to navigate file/folder on device filesystem.
All applications on BlackBerry are installed to special memory block, it is not a filesystem. It is a closed memory block of internal memory dedicated to installed applications.
It has flat structure, and there are no folders. All files of installed applications have to have unique names. Otherwise new files will replace existing ones.
Also, as you are a newbie, this link will be helpful: https://bdsc.webapps.blackberry.com/java/documentation

Deploying Android Hello world on DELL XCD35

i have created a successfully hello world program with an image in it. and here is how it looks on windows 7
I have now connected to my DELL XCD to the computer, ensured that "USB Debugging" is ticked and also made sure that "Settings > Applications and enable Unknown sources" is ticked
I have followed all the steps given here - in android documentation
But the following steps fail:
You can verify that your device is connected by executing adb devices
from your SDK platform-tools/ directory. If connected, you'll see the
device name listed as a "device."
Here no device is displayed in command prompt.
If using Eclipse, run or debug your application as usual. You will be
presented with a Device Chooser dialog that lists the available
emulator(s) and connected device(s). Select the device upon which you
want to install and run the application.
And this doesn't happen
I have the following packages installed currently
So how to deploy my simple hello world program on my phone now?
After exhaustive search i found out that the USB driver required for
my DELL XCD35 was available in the form of a .exe file on my mobile's
original Micro SD memory card. The shocker was that there was no
direct download available from DELL's website for the same. So if you
loose this file, or have exchanged the Micro SD card for a better
version then you are in trouble as you wont get it from DELL also.
So folks, i have uploaded the same file for those who want it. - Dell Phone Android USB Connector Device Driver
PS: I spent so much time on this silly matter that i had to let others know of this and wrote an article for the same, so that others don't make the same mistake lol.

Categories