hey all,
I have data in a sql file on a android tablet. What is the best way to get it from the tablet to the pc, i dont care if its going through wifi or via a usb cable or whatever, i just want the data from the tablet to the pc, how can i do that?
All suggestions are welcome!
What is the best way to get data from android app to pc?
-
- Posts: 143
- Joined: Tue Feb 25, 2014 1:27 pm
Re: What is the best way to get data from android app to pc?
The most convenient way would be Bluetooth, or your WiFi network. If not that, a simple USB cable (I connect my Android Phone via USB, it's own File Manager allows drag and drop between the two), or a USB Key.
You could also Upload the data from the Android device to your website server, and download from there.
Also Check out the free service We Transfer, it's fast and easy to use:
https://wetransfer.com/
You could also Upload the data from the Android device to your website server, and download from there.
Also Check out the free service We Transfer, it's fast and easy to use:
https://wetransfer.com/
Re: What is the best way to get data from android app to pc?
Hi,
Take for example this code: Where can i find the file mydb.sqlite so i can transfer it to pc?
Take for example this code: Where can i find the file mydb.sqlite so i can transfer it to pc?
Code: Select all
Procedure CreateFileCallback(Status, Filename$, File, SizeRead)
Select Status
Case #PB_Status_Saved
Debug "File saved: " + Filename$ + "(" + SizeRead + " bytes)"
Case #PB_Status_Error
Debug "Can't save the file: " + Filename$
EndSelect
EndProcedure
Procedure PerformQuery(DB)
If DatabaseQuery(DB, "Select * From SuperHeroes Where Prename = 'Peter'")
While NextDatabaseRow(DB)
Debug GetDatabaseString(DB, 1) + "," + GetDatabaseString(DB, 0)
Wend
FinishDatabaseQuery(DB)
Else
Debug "DatabaseQuery() failed: " + DatabaseError()
EndIf
EndProcedure
Procedure ReadFileCallback(Status, Filename$, File, SizeRead)
Select Status
Case #PB_Status_Loaded
Debug "File loaded: " + Filename$
; Get all the file as a new buffer
*Buffer = ExportFileMemory(File)
Debug MemorySize(*Buffer)
DB = OpenDatabase(#PB_Any, *Buffer)
If DB
Debug "OpenDatabase() read from file: OK"
PerformQuery(DB)
EndIf
Case #PB_Status_Error
Debug "Can't read the file: " + Filename$
Debug "Creating a new database"
DB = OpenDatabase(#PB_Any)
If DB
Debug "OpenDatabase(): OK"
DatabaseUpdate(DB, "Create Table SuperHeroes (Prename TEXT, Surname TEXT)")
DatabaseUpdate(DB, "Insert Into SuperHeroes (Prename, Surname) Values ('Peter', 'Parker')")
DatabaseUpdate(DB, "Insert Into SuperHeroes (Prename, Surname) Values ('Peter', 'Jackson')")
DatabaseUpdate(DB, "Insert Into SuperHeroes (Prename, Surname) Values ('Bruce', 'Wayne')")
DatabaseUpdate(DB, "Insert Into SuperHeroes (Prename, Surname) Values ('Clark', 'Kent')")
PerformQuery(DB)
; Now save the database to a persistent file
;
*Buffer = ExportDatabaseMemory(DB)
If CreateFile(0, "mydb.sqlite", @CreateFileCallback(), #PB_LocalStorage)
WriteData(0, *Buffer, 0, MemorySize(*Buffer))
CloseFile(0)
EndIf
CloseDatabase(DB)
Else
Debug "OpenDatabase() failed"
EndIf
EndSelect
EndProcedure
; Try to read the database if already present, or it will create a new one
;
ReadFile(0, "mydb.sqlite", @ReadFileCallback(), #PB_LocalStorage)
Re: What is the best way to get data from android app to pc?
You could try to upload your file on your server and get it back with an url on your PC
Re: What is the best way to get data from android app to pc?
But where do i get that file? I cant find it with the file explorer on android, or as it is connected with the pc?
How do i get that file? Where can i find it?
How do i get that file? Where can i find it?
Re: What is the best way to get data from android app to pc?
It's stored in the the browser localstorage, so it's not on the android filesystem. You can try to send the memory buffer to the server, or try an ExportFile() which should trigger a downloadfrom the android app.
Re: What is the best way to get data from android app to pc?
I tried already a ExportFile() on android but nothing happens.
Re: What is the best way to get data from android app to pc?
Can someone test this out? maybe its just me, but nothing happens with that in android.Fred wrote:or try an ExportFile() which should trigger a download from the android app.
Re: What is the best way to get data from android app to pc?
*bump*T4r4ntul4 wrote:Can someone test this out? maybe its just me, but nothing happens with that in android.