Identifying symlink to avoid "infinite" loop when browsing files. - Android Software Development

Hi,
I have tested this behaviour on both a N1 and the emulator. Could anyone tell me if that is a problem? How can I avoid the recursive code going forever? What is happening?
If you use any file browser/manager and starting going into /sys/devices/w1 bus master/subsystem/devices/w1 bus master/subsystem it will go inner forever, repeating that pattern devices/w1 bus master/subsystem/ all the way.
So when I run a recursive search it keeps going deeper and deeper and seems never to finish.
What is happening, how to avoid this behaviour?
I tried different file managers and they all seem to be going forever into these folders, although when I do a search through Astro it doesn't seem to get stuck with this loop (It seems to ignore the /sys folder, but I am not sure if this happens also in any other folder).
Some people point me this problem can be related to symlinks, but I didn't find a way of checking for those symbolic links with Android's Java.
I know it can be done (as proved by Astro file manager), I just don't know how.
Hopefully it won't involve any call to functions which I'll have to create using NDK, which would be a pain.
Regards.

astro goes infinite for me on an N1
I think any app needs to do some extra checks instead of following stuff down.
eg the "find" command has the "-follow" option
open a terminal or use "adb shell" and "cd /sys/bus"
now type in "find" and it will display all the files directories and symlinks without following them
now type in "find -follow" - you will need to press Control-C to get out, you will see that each line has an error "too many symlinks" - kernel has protection/limit for symlink levels.
writers of file managers could easily fix this, but you have to ask what you were doing in their anyway?

Lol, I was trying to find some info to address this problem under Android & found a relevant thread I thought might help, only to discover it was you (jfbaro) having this conversation on another forum
Specifically, this thread on anddev.org.
I don't know Android yet, but a getCanonicalPath() like call is always going to be at the heart of spotting in advance & avoiding this type of problem, whatever your environment & language. If it doesn't work either the function is broken or you're making a mistake somewhere, I'm fairly sure.
In the above thread you say this doesn't help you. Can you post what getCanonicalPath returns for both /sys/device/subsystem/ & /sys/device/subsystem/sys/ ?
Let's assume you start your traverse at / & have reached /sys/device/subsystem/. When you check to see if it's safe to follow /sys/device/subsystem/sys you should discover that the latter is actually /sys, and that further, it is in your list of already scanned directories, hence you do not search further down that branch.
Where is this breaking down?
[Edit:] You might also find something of use buried in this bug thread which involves similar issues. Funnily enough it concerns Eclipse, but all that matters is that it's a Java based example of the problem. From a quick scan, getCanonicalPath again seems to be the solution though I think they avoid any performance hit by only using it on files known to be sym-links.

Related

MobilMon - File system monitor utility

To the many excellent folks here at xda-developers.com, I'm releasing MobilMon 0.5 for free.
I wrote a simple app that monitors file system access (specifically, file creation, deletion, or modification). This sort of tool can be invaluable when you are trying to figure out what's happening on your system. You can export the findings to a log file.
It's pretty bare bones at this point, but that was somewhat intentional. I wanted to see what folks wanted out of such an app before spending more development time on it.
Check it out, and let me know what you think: http://www.mobilmon.com
wow! thank you! this is pretty much exactly what i was wishing for ever since i started playing around with new apps and such on my phone.
it's a great help for just before a system backup. for example, i have SPB backup set to run every other morning. let's say it runs on Saturday at 5:00am. I install some apps and do some random things from 8:00am to 9:00am. 9:30am, my phone crashes. I reset to 5:00am, and I lost all that stuff i did from 8 to 9. now i know! thanks for this app.
Feature changes
A couple of things I was considering:
1. CSV EXPORT. Would it be better to leave the plain text formatting for easy readability, or format it for CSV export?
2. DIRECTORY. I was originally going to include the ability to change the directory (i.e. something other than just "\") but that would involve some significant work on my part. And, I'm not sure if you'd really want to do that anyway.
3. VIEW FILE READS. As delivered, it monitors file adds, deletes, and changes - not reads. This was done intentionally for performance reasons. Would people want to see all the file reads, even if it bogged the device down?
This is awesome! I haven't seen anything else like it, so I am really happy to see someone from the xda-forums to make this magic!
I think that you should add in the view file reads, but only as an option. Maybe also an option to select which operations you want logged (eg. when I only want to see the files created, and not deleted). Although being able export to CSV would give me the same results, but with some editing.
3. VIEW FILE READS. As delivered, it monitors file adds, deletes, and changes - not reads. This was done intentionally for performance reasons. Would people want to see all the file reads, even if it bogged the device down?
Click to expand...
Click to collapse
Many thanks for the app.
It would be nice to have (even as a separate app) something like mamaaich's file monitor: http://forum.xda-developers.com/showthread.php?t=247425, with ability to start/stop and good frontend - to capture all file activities in the whole system.
It helps a lot to find frequent, unintended system file reads (in most cases - draining batteries)
monitor lost memory
i wonder if you could add some powerful memory mgmt to check where my pda memory is lost and what is the process,application or service which is causing memory leaks or using too much memory. maybe you could draw a graph or monitor memory usage during time for all processes. when i start my pda i have 48% free ram, after a day i am back to 80% without any visible app running.
Thanks!
Thanks
Thanks for the good feedback; I'll look into making it where you can select the types of events to monitor and then go from there.
Good lead on mamaich's program - I wasn't aware of it. I will take a look. I'm all about working smarter, not harder
Hello,
I stumbled over this (admittedly quite old) thread on the search for a windows-mobile version of something like iTunes FolderWatch or iPad ShutterSnatch.
Would it be possible to extend MobiMon such that an action can be triggered once a new file is found? In my case that action would be to start a picture viewer with the newly created file name as a parameter.
Scenario: Send pictures I take with my camera to my Windows Mobile Phone (HTC HD2) via FTP (MochaFTP) through an Ad-Hoc Network directly from the camera (using Eye-Fi). MobiMon would recognize the new file and fire up the picture viewer. This way, the latest picture taken will be shown on HD2's big display right after the shot was taken.
Of course, if there is a more streight-forward way of doing this (like a picture viewer with integrated FTP-Server ) I'd be more than happy to hear about it!
Regards and a happy new year!
Alex
Yes, it's possible.
In regards to your inquiry, it's programmatically possible, but would require a re-write. This has to do with the way things are instantiated. Whether I could afford the time to do it is a different question
1. What is the target OS?
2. Do you have the means and skills to adjust my code and compile it yourself if I just pointed out the changes needed?
allright, heres my question:
is it possible to add (i.e)tray/taskbar icon showing card r/w activity?
I am thinking not exactly about this specific project, but general idea related to it.

Watching Video on your Xoom

Most of the information in this post is covered in various threads but I was recently looking for various options for playing video on my XOOM and found it frustrating having to look all over the place. I'd like to try and make this a comprehensive guide to playing video on the XOOM, including streaming over wifi, playing directly from the device etc.
Before you read on...
This isn't always a necessary step, but whenever you plan to interact with your device via USB you should ensure you have the latest version of the USB drivers from Motorola. In my case I was able to access the XOOM and move files to it without any specific drivers, but it's a good idea to keep them up-to-date to avoid potential frustration. Of course if you need to use ADB, you will absolutely need the latest drivers or you'll have no luck at all.
Playing directly from the XOOM
This is obviously the simplest solution, copying the video files onto your XOOM and playing them directly. This won't be the most appropriate solution for those of you with extensive digital media libraries, but we'll cover solutions for that later.
Plug your XOOM into your PC using a micro-USB to USB cable, one of which is typically provided in the box. You'll see your device pop up under "Computer" (Windows 7 & Vista) or "My Computer" (Windows XP).
Double click the device and you'll see that you're able to directly access the device's internal storage.
Double click that and you'll now be looking at all the folders and files on your device
You can now copy files to the device as though it was any other folder on your computer. Feel free to create a folder (I use one called "Files from Computer") if you'd like to keep your copied files separate from the system created stuff.
Choose your player! With all the files copied over to the XOOM, you're ready to play them but you'll first need a decent player capable of playing a range of formats. A couple of my favourites are:
vPlayer
Rockplayer
If there are others that should be added to this list, let me know.
You're all done - either of the above players should be able to play most video files, though I can't say I've really pushed them as most of my files are just XviD avi's. In my experience I've found vPlayer to be slightly better than Rockplayer especially when it comes to seeking, but Rockplayer's free version is an ad-supported full version and vPlayer's is just a temporary trial so it comes down to preference and willingness to pay for a little extra functionality.
Streaming over Wi-fi
This is going to be the preferred solution for many people, since it doesn't involve any copying/moving of files and will allow you to access that media library that you've spent so much time meticulously organising. There's a few different approaches here, I'll cover the simplest approach first.
Streaming from TVersity
If you already have TVersity set up, then you won't need to do much at all and you can skip straight to step 3. Otherwise, you can follow these directions to get it up and running.
Head to TVersity.com and grab the latest version of TVersity. I won't go through the setup and so forth as it's all pretty straightforward and is covered well in TVersity's own documentation.
Once you have TVersity set up, add your video directories to the library and (optional, but preferable) give your computer a static IP address on the network.
Open up your browser on the XOOM and navigate to "YOUR-IP-ADDRESS:41952".
You should see a TVersity page load up with various navigation options. From here it's pretty obvious how to drill down through your folders and locate any file you'd like to play. When you click a file to play it, you will be able to choose which media player you'd like to handle the file in. I've found vPlayer is capable of seeking and will play it quite nicely, but Rockplayer works well also, just without the ability to seek.
Mounting a Network Share
This is more complicated for the novice user (me, for example) but it works well enough and the end result is a little more user friendly once you get there. The major drawback with this one is you must root your device for this method. If you don't want to root your device, you'll need to use one of the other methods discussed in this post. This method allows you to mount a folder that you've shared over the network so that it can be accessed on the tablet as though it's actually a part of the tablet's file structure. This means that almost all video players should simply play the files without too much trouble (at least, theoretically; I can confirm vPlayer and Rockplayer as working with this method).
There are two apps capable of mounting shares, but before we get into that we'll need to ensure you have a CIFS module installed. If you're like me, you're probably wondering wtf a CIFS module is. When you root your device (I used the "one click" process described in this thread) you'll need to find a "cifs.ko" file that matches the particular kernal you've installed. If you use the aforementioned method, you'll find a cifs.ko file you can use inside the zip file (inside the "timat" folder).
Once you have the module use Root Explorer to copy it (or use adb to push it) to this location: /system/lib/modules/cifs.ko and then reboot your XOOM. If you have adb installed on your computer, you can use these steps to verify that it's loaded:
Code:
adb shell
lsmod
You'll be wanting to see the CIFS module in the list as a loaded module. If it's not loaded try typing:
Code:
insmod /system/lib/modules/cifs.ko
If you get an error like I did saying "exec format error" it means you've got the wrong cifs.ko for your kernal, so you'll need to poke around some more and locate the right one.
Congratulations, if you've made it this far you've completed the hardest part - the rest is easy.
Make sure you have an actual folder shared to "Everyone" on your network. Optionally, but preferably, give your computer a static IP address. If you don't do this you'll need to change your settings every time your computer gets a new IP.
Install "Mount Manager" or "CIFS Manager" from the android market. I'll give instructions for CIFS Manager but Mount Manager is just as good and works just fine if you'd rather use that.
Open CIFS Manager. You'll need to do this from the "My Apps" section of the market because for some reason it won't start from a shortcut or from the apptray - annoying!
Open the app-menu and select "Add New Share..."
Your share path should be: "IP-ADDRESS/FOLDER-NAME"
Your mount point will be the location you'd like to mount the share to on your internal memory. By default it likes to mount in "/mnt/cifs/FOLDER-NAME", but this is really up to you. Pick whatever you like here and then go to the next field.
Username/password will be a valid account you can use on the computer hosting the share. I just used my regular Windows 7 account here.
Click "Save Share".
Long-press the new share you've created and then select the option "Mount" when it comes up.
If all is well the icon on the right will turn green and you can now access your share by browsing to your mount point in your favourite video player.
Encoding video for optimal playback
-- COMING SOON --
Conclusion
As I mentioned at the beginning of this post, I had a lot of trouble filtering through all the different posts on this topic and it took a lot of time for me to eventually find and experiment with each of these different options. Hopefully I've saved you all some time and helped out with some of the sticking points you might encounter. If anyone has anything they think I should add, just let me know.
I do plan on adding a section for streaming over 3G, but since I haven't tried it myself (I have a wifi-only XOOM) I can't really contribute to that side of things yet.
If you catch any typos or errors in the above text, please let me know asap and I'll fix them right up. This is my first thread here, and I haven't even made 8 posts yet so I couldn't include external URLs, I'll go through and edit some useful links in as soon as I'm able.

getting data off of broken G1/Dream [rooted]

I have a broken G1, the screen is shot, and something else is screwed up, because it won't process anything. Once it boots it shows the background for a moment, then the lock screen comes on, but without a background. Then it looses all functionality. I can't get it to do anything. However, what's interesting, is that if I get an incoming call, I can answer using the button (not screen), and talk normally. Anyway, I want to know if there is a way, probably using ADB to get all my contacts minimally (since they're not all sync'd w/ Google), but ideally I would like to make a system image from it and run it in one of the emulators (Eclipse, Spring Source or Android SDK is what I have installed now). Any help would be awesome. There are also a few nandroid backups that I could use somehow, but they are a little old.
As far as I know, contacts data is stored in a sqlite-database which is located on /data. As long as you can connect with adb to your phone, you can copy that database to your pc and analyze it using sqlite3.
In this article you can find some additional information. It's a bit old, but still valid and at least it can give you a hint.
If you cannot access to your phone using adb, you can also extract the contacts.db from your latest nandroid backup. You can use unyaffs or mount your image on a linux system as yaffs file system and extract the file(s) you want. Then you can use again sqlite3 to extract the contacts data.
The same way, you can extract other data. It's enough to concentrate on the /data partition of the G1. As long as adb is running, you can copy them to your local PC, if not, you need to extract them from your latest nandroid backup in the same way I described above.
there is an awesome application called droid explorer (i forget the developers name) that you can download free to your pc (probably mac too) if you have usb debugging turned on then all you have to do is plug your phone into pc via usb.
when your phone comes up you have all the options you need here plus more!
seriously i recommend it to everyone. i use it at work sometimes to access my phone without getting caught, it has a great screen-cast function (a bit laggy)
if you dont have usb debugging turned on then look in the forum how to do it via adb. if you cant find droid explorer let me know and i can put it in my dropbox.
another option is get a used g1 from ebay and swap motherboards. or just fix your screen or whatever the problem is
Ok... So I did a little snooping via adb, and fortunately I did leave usb debugging on, so that's a plus. Now there were 2 things that I've tried pulling:
/data/data/com.android.contacts
and
/data/data/com.android.providers.contacts
Unfortunately, these both just gave me .xml files that only had a few lines of code, none of which included contacts or any kind of useful info.
@AndDiSa: I'm going to read the linked article now, but currently I don't have anything useful from /data. Any tips on how I would go about extracting the contacts.db? Articles or links are always great!
@demkantor: I will check that out. Since I don't really know how messed up the phone is, I don't know how useful droid explorer will be, but it sounds like a good utility anyway.
I don't really feel like getting parts for my phone. It's already waaaay behind the curve, and while it's a super fun phone to mess around with, I think it's time to move to something new (like the Droid 1 that I got as a toy phone/media player since I don't have verizon).
Anyway, further help appreciated!
(Oh, and I have to replace the digitizer for my Droid. LOL)
I am not on my PC at the moment, but try to look for
/data/com.android.providers.contacts/databases/contacts2.db
at least in GB this should be the right file or do a
find /data -name "cont*db" -print
in adb shell to look for it.
Sent from my Gingerbread on Dream using XDA App
I'll check it out tomorrow and let you know how it goes. Thanks!
OK! Good news. I found the contacts2.db and was able to pull it. I got SQLite3.exe and started messing around with it. Now what I tried from the link didn't work, as I couldn't get the .db file imported, and don't really know how to declare that as the target of commands. Using the .tables or .databases commands didn't get any results either. .databases just said something like 0-Main and 9-local or something. Do you know how to pull this part off? Hope to hear back soon.
Thanks,
kyle_engineer
Didn't try to use sqlite3 on windows yet, on the phone, you need to do
sqlite3 contacts2.db
> .dump
and you will get all content of the database dumped as sql statements.
Sent from my Gingerbread on Dream using XDA App
Awesome man!!! the .dump worked and I was able to actually get a table output on the screen. Now I just need ot know how to make that something printable (ideally), and I need to try it with my actual G1, not my Droid1... I'll thank you tomorrow when it's done.
Ugh!
So I've been able to correctly import a .db from my droid 1 and get it properly printed on the screen using sqlite3. That worked fine. Now I've pulled the .db from my G1 (which has the needed contacts), and I can't get it to print correctly. Here is what I'm dealing with...
Code:
SQLite3 version 3.7.20
Enter ".help? for instructions
Enter SQL statements terminated with a ";"
sqlite> .tables
_sync_state settings
_sync_state_metadata status_updates
accounts v1_settings
activities view_contacts
agg_exceptions view_contacts_restricted
android_metadata view_data
calls view_data_restricted
contact_entities_view view_groups
contact_entities_view_restricted view_raw_contacts
contacts view_raw_contacts_restricted
data view_v1_contact_methods
groups view_v1_extensions
mimetypes view_v1_group_membership
name_lookup view_v1_groups
nickname_lookup view_v1_organizations
packages view_v1_people
phone_lookup view_v1_phones
properties view_v1_photos
raw_contacts
sqlite>
From here, no matter what I try to use the .schema and "select * from XXXX" on, I don't get any user friendly table like I did with the other .db file... could something be messed up with this .db?
Please let me know when you get a chance.
Thanks in advance!
-kyle_engineer

Playstation Vue on rooted Fire TV

Has anyone figured out how to get ps vue to work with firetv that is rooted? I've gone the route of renaming su.apk in shell to xsu.apk. When I do this I can access root in shell but can not give permission to installed rooted apps on screen. I've tried root cloak. It's a no go. Plus why is there no gui for su for fire tv. Any help would be greatly appreciated. Thanks.
1. What did you think would happen if you rename your su and Superuser.apk? It all would magically work regardless?
2. Other people report that Root Cloak worked for them as recently as 24 days ago. Might not work on the FireTV - but still...
3. You can get the information on why the su GUI does not work on the FireTV from here:
http://forum.xda-developers.com/showpost.php?p=68273660&postcount=67
Thanks for replying. By changing su name I still have root abilities through adbfire. I can access and change root files. The issue is once I originally grant root access on fire tv I can never get it to appear again. Is there any way to clear su.apk access without gui? In app section all su options are grayed out. It's strictly read only su. The link below is the post for renaming su files. It does work. System is still rooted. I just can't get popup to grant access to apps. I've been trying off and on for a few months. Any help would be greatly appreciated. Thanks.
http://forum.xda-developers.com/fire-tv/help/playstation-vue-fire-tv-fire-tv-stick-t3247813/page2
Not through adbfire - through adb and the shell.
Adbfire is a "eazy to use" frontend that prevents users from learning to navigate using adb commands and the shell by makeing them click buttons with preset commands backed in, that sometimes are just silly. Then it pops up fake progress counter animations to put their minds to ease.
Every time someone says that "adbfire doesn't work" I die a little bit more, deep in my heart.
But you have made it to the actual shell, so congratulations, you are using the real deal.
-
Here is what happens as far as I understand it - could be wrong - but it is a pretty educated guess.
Once you rename su and Superuser.apk - all apps loose access to it.
The prompt is not poping up, because the apps already think they have SU access - but because they cant access su.
Here is why.
Apps that require su, have to address su, and they certainly don't expect su to be named xsu.
Its great that you can call su functions by typing in xsu into the shell instead - but that won't help your apps.
If an app cant get su access - it usually just prompts su and the Superuser.apk again. There is no need to "clear Superuser.apk access" in fact - just uninstalling an app that requires root and reinstalling it again is enough for the rootmanager to forget it ever existed. So you can in fact test your theory that way. My best guess is, that you are wrong and it won't work regardless, because none of the apps calls a binary named xsu. xsu could in fact be named "makeamericagreatagain" and it would make no discernible difference.
The thing why I preface this with "I could be wrong" is, that I havent looked into how systemless root works, and how those guys get root access to their apps, without having a binary named su in /system. Maybe the apps call Superuser.apk (which is now called xSuperuser.apk so they cant find it) and xSuperuser.apk of course cant find su, because you renamed it xsu. But in any case - they are not using the usual Superuser.apks
Thanks for the quick reply. You are right about the renaming of su. I tried same thing on old tablet and got the same results. Even with having gui access. I could not get it to grant root abilities. Next step is to find a way to edit apk's and find a way change where it looks for root files. I only need to edit 3 apps. (adaway, xposed, and hdxposed) If can figure out how to do it once the others should be easier. This should be interesting.
Now here is something that could work. I'm a bit hesitant to recommend you doing it, because you are constantly modifying system files - but if you were willing to risk it before... It might work.
Read up on a program named "Remote adb Shell" in here
http://forum.xda-developers.com/showpost.php?p=69050521&postcount=3
Then maybe try two commands like these:
su -c 'mount -o remount,rw /system /system && sleep 1 && mv /system/app/Superuser.apk /system/app/XSuperuser.apk && mv /system/xbin/su /system/xbin/xsu' && exit
and
xsu -c 'mount -o remount,rw /system /system && sleep 1 && mv /system/app/XSuperuser.apk /system/app/Superuser.apk && mv /system/xbin/xsu /system/xbin/su' && exit
Now - understand, that I havent tested this myself - also - I havent looked if you need to chmod modify the su file first (add another
&& chmod 761 /system/xbin/su
- at the appropriate spot(s)), which you do according to this thread https://www.reddit.com/r/fireTV/comments/41e8z3/ps_vue_aftv_1_with_root/?st=iuk3lgx4&sh=36edc941 (which I think you took the method from) --
but if it works - it would allow you to switch between "rooted" and "non rooted" states with a few presses on your android smartphones (or tablets) screen.
Now - I don't know if you would need to reboot the AFTV for root or VUE to work again -- (make another entry with just
reboot
- in it) . The reboot might kill the concept - because switching between the states might take too long.
Also - you do this at your own risk. If you loose root (or worse.. ) as a result of this - its not my fault.
install xposed, install rootcloak and block the vue apk by package name. I use that method on my shield tv. Just reset my ftv so I'm still trying to set everything up before I get to this.
There you go.
Should have looked into the "doesn't know how to use rootcloak" angle a bit more.
Definitely the better solution. Go with that.
Just like you should go to "I'm a **** and my comments don't provide any help others than to prove I'm an asshole section."
This is a forum for questions and help. Thanks Noggind614 he gave me the correct command for the fire tv and root cloak. Don't use the phone or tablet com entry. For fire tv its. "com.snei.vue.firetv"
Thats not a command, thats literally the process name of the app others have suggested <ou to block with root cloak before.
Oh, and here is why I hate dumb people.
- They rather complain about solutions not working than to learn how they work. If you don't constantly have the filter on, that everything they say might in fact be just a made up "fact" trying to mask that they werent able to use an app - you are out of luck entirely, and situations like these happen.
- When they then resort to renaming system apps - because reddit told them to, not knowing what they are doing, and you have to explain to them, that stuff breaks, because they broke it - the< might act interested and willing to learn for a moment -
- but as soon as someone points out, that they don't know jack, their "facts" are all kinds of wrong, and the better solution was suggested by every entry in google, this forum, and even by myself (hinting at that it would be strange, that people report cloak works as recent as a month ago..) - they become tonguetied, and when you weigh in to make it clear for others that the solution the excluded from the beginning as "not working" is in fact the best one --
they take it ultra personal - and switch from thanking you for explaining to them how stuff works, to calling you a dickface -- because it becomes so very obvious whats wrong here.
So they are the assholes. They think the internet is here to serve them without even calling a dog a dog, they cause the majority of confusion in stating wrong information to begin with, they switch from thanking you for explaining to them what they are doing to calling you a dickface - because you just made it clear, that the solution someone else brought up is in fact the better one, so others wouldn't bother to go through the same pitfalls they went through - oh, and all information you have provided them so far all of a sudden becomes null and void - because it was just that, information - and not the entire step by step solution they wanted people to provide in the first place.
Now - not even "block the app with root cloak (exposed)" is enough information for someone like you in the end. No - you need a PN conversation to clarify that you should block the process everyone told you to block in the beginning. Because you didn't bother to find out how its named.
Instead of typing ps into the Fire TVs shell (or ps | grep vue), you used this forums PN function to ask someone else to do it for you. And you didn't have to know the ps command either, you probably could have looked up the apps (process) name elsewhere on the net.
Here i the mea culpa on my part. I am not a PS VUE user, because the service is not even available in my country. I might react threads though, where people rename android system files, and then complain about them "not working". I don't if blocking within root cloak using the process name of an app is something out of the ordenary, if it is, some of my criticism doesnt apply, although I highly doubt it at this point.
Tldr.
Dont ever take agreeing with someone else on what would be the best solution, as mocking you personally. I know that reddit QA culture demands, that every thread is a personalized support session for people with no clue but high aspirations - threads on forums usually are not. Clearing up "what the best solution seems to be" for the next person that reads along is something I don't do out of malice, I do out of responsibility.
Well, at least until someone calls me a **** for not providing an easier solution for them faster. Then all bets are off.
Everytime someone explains somethng on an open internet forum, there is the notion, that others are reading it, and that the information they are providing gets used further - that just the immediate support session they are driving at a time. This is the sole cause - why people might not wan't to protect you or others in the "looking fly" department - while you are actually -
- promoting, that people should modify system files - and then expect stuff to work regardlessly
- making it sound like a fact, that stuff doesn't work, when its actually working
This is not "acting like an asshole", this is actually responsible behavior.
n00bs usually don't become educated users, by calling the people explaining stuff to them dicks, or accusing them of "saying unimportant stuff, because - you just needed a step by step instruction, which you finally solicited from someone via PN - good job" - or by putting down people, that explain stuf to them, because it makes them look like n00bs.
This goes for me as well - in other areas.
Yet I never got the demand, that others should fix your issues for free, and on the spot, in detailed step by step instructions, while making it extra sure, that you can save face, and look like a hero at the end of the day - also what dicks, are they for actually daring to try to explain stuff to you instead of just fixing your problem.
Have I mentioned, that I sometimes hate what has become of the web in the recent years? Signs of getting old...
Also, yes, I do think that this response was needed.

NST library files

Anyone knows where the files/databases are for the library to use, e.g., sorting files for recent, author and title, as well as for shelves. It seems the library module from time to time doesn't sort correctly, after adding new books. Sometimes, a book from search is not placed in the 1st in the library ( for most recent order ). So I guess there must be something wrong in related files. Any tips are appreciated.
smjohn1 said:
Anyone knows where the files/databases are for the library to use, e.g., sorting files for recent, author and title, as well as for shelves. It seems the library module from time to time doesn't sort correctly, after adding new books. Sometimes, a book from search is not placed in the 1st in the library ( for most recent order ). So I guess there must be something wrong in related files. Any tips are appreciated.
Click to expand...
Click to collapse
AFAIK there is nothing specifically for the Library app other than an xml file (/data/data/com.bn.nook.library/shared_prefs.xml) which I imagine is supposed to control how the various library options display when the library is accessed. I've never had any luck with changing the settings (which are obfuscated anyway) as I would like the library to open a certain way but it insists on reverting to something else no matter how many times I set it.
As for databases, there are two associated with the Reader app (/data/data/com.bn.nook.reader.activites/databases/lastreadingpoint.db and /readerlocal.db). Historically there have been issues with the databases becoming garbled and there are a couple of postings somewhere in the forum with sqlite sequences for clearing out the dross and starting over. I'll see if I can scare those up but you should search also. And you'll need a sqlite database viewer if you want to examine the databases on your PC to see what's there.
Edit: This is the main thread I was remembering: https://forum.xda-developers.com/t/solved-on-the-problem-of-broken-bookmarks.1467429/
nmyshkin said:
AFAIK there is nothing specifically for the Library app other than an xml file (/data/data/com.bn.nook.library/shared_prefs.xml) which I imagine is supposed to control how the various library options display when the library is accessed. I've never had any luck with changing the settings (which are obfuscated anyway) as I would like the library to open a certain way but it insists on reverting to something else no matter how many times I set it.
As for databases, there are two associated with the Reader app (/data/data/com.bn.nook.reader.activites/databases/lastreadingpoint.db and /readerlocal.db). Historically there have been issues with the databases becoming garbled and there are a couple of postings somewhere in the forum with sqlite sequences for clearing out the dross and starting over. I'll see if I can scare those up but you should search also. And you'll need a sqlite database viewer if you want to examine the databases on your PC to see what's there.
Edit: This is the main thread I was remembering: https://forum.xda-developers.com/t/solved-on-the-problem-of-broken-bookmarks.1467429/
Click to expand...
Click to collapse
Thx, I will dig a bit. Strange thing is just read books from search don't appear in library's beginning at all. On the other hand, books read from library do change order in the library. Besides database, any other possible modules that would such problems?
smjohn1 said:
Thx, I will dig a bit. Strange thing is just read books from search don't appear in library's beginning at all. On the other hand, books read from library do change order in the library. Besides database, any other possible modules that would such problems?
Click to expand...
Click to collapse
I've come up empty. From examining the two Reader databases it is clear that they do not contain any information that would create placement in the Library such as shelves. That information must be somewhere but I have not been able to find it. There is another database, home.db, which is part of the bn.home app. There is minimal data there about books, but nothing helpful.
What is distressing (besides not being able to track down where this information is stored) is that there seems to be no mechanism to flush out the databases. Looking over mine I see (sideloaded) books that I have deleted a long time ago. No wonder things act funny after awhile.
Edit: Never say never. This post: https://forum.xda-developers.com/t/automating-shelving.1378510/ reveals the whereabouts of the information for the Library. I never would have guessed B&N would use stock Android for that!
Yeah, there used to be problems with the MediaScanner on the NST.
I got used to not relying on it.
Even now, my Library app has a fixed number of locations for books and you just hit Refresh once in a while.
The AdbSync script (makefile actually) that I use just pokes a refresh after syncing the Books directory.
nmyshkin said:
I've come up empty. From examining the two Reader databases it is clear that they do not contain any information that would create placement in the Library such as shelves. That information must be somewhere but I have not been able to find it. There is another database, home.db, which is part of the bn.home app. There is minimal data there about books, but nothing helpful.
What is distressing (besides not being able to track down where this information is stored) is that there seems to be no mechanism to flush out the databases. Looking over mine I see (sideloaded) books that I have deleted a long time ago. No wonder things act funny after awhile.
Edit: Never say never. This post: https://forum.xda-developers.com/t/automating-shelving.1378510/ reveals the whereabouts of the information for the Library. I never would have guessed B&N would use stock Android for that!
Click to expand...
Click to collapse
Wow! Thx. I need to learn sqlites to see all the contents.
Renate said:
Yeah, there used to be problems with the MediaScanner on the NST.
I got used to not relying on it.
Even now, my Library app has a fixed number of locations for books and you just hit Refresh once in a while.
The AdbSync script (makefile actually) that I use just pokes a refresh after syncing the Books directory.
Click to expand...
Click to collapse
how tro refresh? Is there adb code for that? Thx again.
smjohn1 said:
Wow! Thx. I need to learn sqlites to see all the contents.
Click to expand...
Click to collapse
You can do sqlite manipulations via ADB is you have sqlite3 installed on the NST, but for a better overall view you really need to copy the database file to a PC use a tool like this.
smjohn1 said:
How to refresh? Is there adb code for that?
Click to expand...
Click to collapse
Not really.
There are ways to make the MediaScanner scan a single file.
There is no simple way to tell it to just rescan everything.
I was talking about my Library.apk which does a simple foreground scan when you:
Code:
adb shell am start -a com.temblast.library.REFRESH

Categories

Resources