Android save custom data in APK - android

I have developed (Offline) Android app in which i have to save some employee's data into Local SQLITE database, when i send the apk into another andoird phone the data in the database dose not appear due to local storage of both the devices is different.
My goal is to send the data with the apk file to who ever i send the apk. How can i achieve the goal ?
The problem is i do not have the idea of how to do it, or never have done this kind of project before.
Please guide me.

If Your database is read only - You can use raw folder of project for Your SQLite database file, than, after .apk was installed, copy it, for example to external storage. But if You need changes in database and synchronized data on all devices - You should use only one server-side database.

Related

How to publish a specific file?

I have an android app where I embed in assets folder a CSV file about 1MB. This file contains 20.000 records of data and it's for read-only. Until now whenever I need to add/remove some records I publish a new apk with the updated CSV. This happens about once per week and usually, the app has no other changes.
I'm thinking of another way to update the CSV file in the user's device.
One option is the app to download the file from some CDN.
Is it possible through play-store to upload there just the file and somehow to be pushed to the user's devices? I'm not sure if Android App Bundle can be used in my scenario.
You can host the csv file on server. If you find its too hassle to build and manage you custom server, you can use Firebase Storage. And even better and efficient solution would be to parse the file, insert it into in Firebase Realtime Database and when updated, user will only get the update portion

Upload images to Azure Blob Storage from an Android device With Offline Sync

From My android Application want to Capture a Image ,With a Text Field.
Text fields Data need to Save In Local Sqlite Database(Like TodoItem Table)
,Image will Save in Sdcard With Offline.
When Internet Comes Image Need to Sync in Azure Blob Storage, Text data need to Sync in Azure Todoitem Server Table.
I tried Below Links, for Offline Data Sync is Working. But Offline Image Upload to Azure not able to find Any code or Link.
Please help me to Find the solution
Link I tried for Image Upload to Azure Online Mode
Offline Data Sync
This is not possible in todays Android SDK. As a result, you will end up rolling your own offline sync for images. Sync logic for static stuff tends to be easy - you read the file list from the SD, generate an API for the server that reads the list from blob or (more appropriately) Azure File Storage and compare the two. Since your list is static, you can download files that are not on the SD card and upload files that are not on the server.
There are two issues you need to deal with if your files are not static. First is updates - generally, files tend to deal with "latest file wins" so you can check and compare the last write timestamp. The second is "deleted files". If you do "deleted files", you will need to create a sync table for the file list (and the Azure Mobile Apps SDK will help you there) - then check your SD card after the sync for files that are on the SD card but not in the table - those should be removed.
The Azure Mobile Apps SDK always contained support for online/offline sync of data, but was recently updated to include support for files. To see how to add offline file sync to your iOS, Android, and Windows 10 apps, check out the linked post.

Android: Need to show Package and Folder that contains database (XML, .TXT) after installation

How to make folder and files that consists of database in .TXT and .XML appear after installation?
I know it was silly question, but I am creating an offline application using SQLite Database. If user submits the data from apps (e.g: insert to do list, create purchase order), the data will be saved and then TXT file is generated.
This .txt has role as database. The apps will get new data from .txt they recieve via email / cable data and upload .txt users generate to email. This feature is really important, so how to make those files appear in file directory? They have to be seen in order to do so.
Beside that, when I installed my apps I cant find my package folder installed. Though I did install my application from file explorer. I know that I can do it with USB Driver, but my PC couldnt update USBDriver to the phone since it said that my current one was newer. So I had to install it using package installer in my files.
I am very new in learning Android, so I hope you wouldn't mind to tell me what I need to do in my code.. Thanks.
my related previous question: Cant generate folders contains Offline Database after Android APK installation

Offline database inclusion in Android apk on real device

I have a question regarding creating an android application for travel guide. I am creating it offline. I am familiar with the problem that we access the database on the real device. I want an external database file in which the data is already filled. I just want to include this database in my apk and just want to access that database in my phone offline. I am using SLQite database. I had imported db file from assets folder. It works on emulator but not on a real device due to no access to system files.
I think this blog post does what you want to do. I am using this approach in my applications for a while and I am satisfied with it.
It is fast and relatively easy.
http://www.reigndesign.com/blog/using-your-own-sqlite-database-in-android-applications/
I have included the db in assets folder and the db file is copied in the path sdcard/Android/data/packagename/test.db on a real device..now I am accessing the db, it works fine on emulator but when I used it on a real device it get crashed.the db is still not working on real device.

Sample data stored locally with a PhoneGap based app on Android

We had initially planned on developing a native app for Android but PhoneGap is looking like a better option.
One thing we need to have is when the user installs the app, they need to have local access to a sample of the data in our back end database but have it stored locally. On the native app we had planned that when the user installed the app, the installation process would also trigger a retrieval of a chunk of the data in the back end database so that they could make basic usage of the app without relying on an internet connection all the time.
This data will include JPG files and perhaps some audio files. Will HTML5's local storage address this requirement?
short answer: YES
That's what makes phonegap awesome, you may create a database in to store the persisting data details (name & path)
When you run your application, you will test the connection, if there is no connection you can refer to the local files through your database else if there is connection you may download the new data, save them to the local database and then delete them from the local storage (Sdcard & database).
to find more check the phonegap's file docs
Just to add to what T.Baba has said, yes it is very possible, and I have recently built a webapp with PhoneGap and jQuery Mobile that does just that.
I used localStorage to contain all the data, and in particular localstoragedb. I haven't stored any images and/or audio files in localStorage and wouldn't recommend it anyway as most devices will limit the space to 5MB, but PhoneGap does give you access to APIs which will allow you to save files on the user's device. You can also of course bundle the files with the app and access them accordingly.
Indeed it is. Phonegap is best option for that.

Categories

Resources