Update a text file in the raw folder - android

I have an application reading a text file that is in the res/raw folder. It works great, but when I change this text file and try to run again the application on Eclipse (I don't need to change the raw file from this application, this I have seen that it is impossible. I just want to do it from Eclipse as I am still in the building phase of my application) and test it on my phony, the text file doesn't take into account the modifications.
The only way I found to update the file in the application is to uninstall it and re-run it.
Is it normal? Is there no way to do that?

As far as i understood, eclipse did not know it was updated, so
Right click on a project -> refresh.
If that does not help try
Project -> Clean

Yes it is a default behavior.
Assuming you dragged a file named "ABC.txt" from D drive inside the raw folder of your project. Project worspace is in E drive.
Once you drag and drop, a new file will be created in E drive inside your application folder. This file is different from the one in D drive.

Problem fixed, it was happening in the Searchable Dictionary (sample application from Android), the fix is simply to increment the database version when it's changed, and it will automatically load it again.

Related

Error on Add file to deploy in Android, with firemonkey delphi Xe7

Which file I manage the deploy Itemns to remove/add manually my database? When I click add file on tool bar (Second button), and select the sqlite file on explorer, I receive an exception below.
It was working very well, and I changed many times the database version before.
But now, I delete the sqlite file and can't submit the file again.
I hope to delete some file on explorer to reset the deploy list. Somebody can help-me?
ps: I restarted delphi and also the windows.
I found the file ProjectName.deployproj. The file has a xml structure with all icons, database and ini specification. I change the file manually but didn't fence the error. I got that the error just occur when I add a filename found in xml. But when I click delete on deploy windows, It don't removes the file. Like has another reference I can not change manually. Some idea? Thanks in advance.

Cordova/Phonegap - Where do I put a data file I want to read?

I've been driving myself crazy trying to find the answer to a seemingly easy question.
I am trying to create my first app using Cordova. I want to bundle a text file with my app that can be read when the app starts up.
Where do I put this file?
dataDirectory seems like a good place, but where is it? Documentation says /data/data/<app-id>/files but where are those data directories? Do I create them?
Update 1: Ok, I think I've figured out that dataDirectory should be pretty much just where the path says it should be, at the root of the file system. But the directory doesn't appear to be created automatically and I don't know how to package a file - a JSON file, for instance - and place it in that directory.
Essentially you do not need to create these directories. Those are created once your app is installed by the Android itself.
A typical way to get this done would be that you could first off add those files in your app's assets directory and then at runtime you can copy those file wherever you want.
There is a repository on Githup which provide a similar functionality.

Where is the SQLite datase file?

I've created an app using Android Studio and it has a database file handler. I've gone through a few post and everywhere they are saying go to data\data\ folder to get the app folder. But mine doesn't show any folder for my app. Do I have to manually set this file location to be created? How can I find my database.db file?
It should be automatically placed in data/data/databases in your app folder unless you specify otherwise. Are you sure it is created?
That is /data/data/package-name/databases/dbfilename
I have another suggestion. If you have enabled backup for your application, you might be able to use ADB BACKUP, like suggested here: http://blog.shvetsov.com/2012/09/backup-your-android-without-root-or.html
The database files are located in the following folders.
/data/data/packagename/databases/
You can access the .db file only on emulator, its not possible on actual device. In the android studio open the DDMS perspective, there on the left hand side you will find the storage structure, there in data/data/ you will get the file you are looking for

Android: viewing files from Windows explorer

I have just made an application that uses a SQLite database, and I finally managed to export the database file onto the computer without having to root the Android device. The method I am using is mostly from code I found on various Stack Overflow question/answers. I am basically saving the database file to the public Download folder.
When I look on the Android device using a file explorer, I can see the correct SQLite file in the correct folder (Download folder). However, when I open up the same folder in Windows Explorer from my PC, I can not see the file in the exact same folder.
Now here is the strangest part: When I copy or move the file (using the Android device), even if I am copying and/or moving the file TO THE EXACT SAME SPOT, as soon as I have finished doing this the file instantly becomes visible in Windows Explorer.
I do not want the user to have to do this manually every time, so does anyone know of any way to make sure that the file will be visible right away? Thank you in advance!
Things I have tried so far:
Show hidden files and folders in Windows Explorer
Programmatically moving the file to a new folder within the application itself (the move to the new folder works, but the file still remains invisible in Windows Explorer until manually moving/copying the file again)
Searched StackOverflow for similar issues and have been unsuccessful.
And if anyone wants to see some of my code, let me know and I will post it, but I am thinking that this is less to do with my code and more to do with Android/Windows interaction. And this is where I got my move folder function from: stackoverflow.com/questions/4178168/how-to-programmatically-move-copy-and-delete-files-and-directories-on-sd
Thank you!
I had a similar issue and it was not visible in Windows because I hadn't given it a file extension.
Give it a file extension if you haven't already.

Is there a way to add such folder in Android project that do no get compiled up to **apk**

I was looking for a way to add some such folder in my Android Project that do no get compiled up to my apk file.
Why I need it :-
We need to maintain proper documentation for project (that actually
everybody needs to ;) nothing new),
but I find it very irritating to look out for that documentation
folder again and again.
.
I am open for any way i can make dcocumentain folder easily one
click accessible (I am already doing it thru taskbar sortcut. ) But
I want it to get the ease of version control thru Eclipse likewise we
do it for our project
IDE :- Eclipse
I got a way myself :-
I had an idea that if I create a folder in my application project with
some anonymous name that actually android has not listed in its
directories ("I am talking about the default one like "res", "src",
"anim"......)
Then either it should "raise an error" or should "ignore" it while compiling to form apk file
luckily it ignores any such folder. now i can put all the documentation in my project.
NOTE:-
My answer empirically driven
I had tested it by creating a "Docs" folder and then copied 1 GB of
random data (includes almost all type of files we came across from
multimedia to zipped ones).
Then I build the apk and the size of the apk was in-effective of all
this..
but when i copied the same data to assets it was showing a huge change
in size of my apk file..
Consider using Javadoc in addition or, if possible, instead of any other documentation.

Categories

Resources