Related
Good evening.
I am currently developing an application and decided to try Admob ads.
Unfortunately after following Admob's guide (pretty simple one, good job on that) I get no ad, whether I run it on the emulator or on my phone (HTC Desire). The weird part is that the ad has shown a couple of times (i really mean just a couple of times), in hundreds of tries. And checking my account on Admob I see that there are 6000 requests from this app.
I started a new applcation, from blank, with no changes.
Any clues?
This is what I have done so far:
Added Adbmo's library jar.
Added these in my manifest (with a proper ID):
<meta-data android:value="axxxxxxxxxxxxxx" android:name="ADMOB_PUBLISHER_ID" />
<uses-permission android:name="android.permission.INTERNET" />
Created a attrs.xml file in res/values with this content:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<declare-styleable name="com.admob.android.ads.AdView">
<attr name="backgroundColor" format="color" />
<attr name="primaryTextColor" format="color" />
<attr name="secondaryTextColor" format="color" />
<attr name="keywords" format="string" />
<attr name="refreshInterval" format="integer" />
</declare-styleable>
</resources>
Added the following to my layoyt (RelativeLayout):
below RelativeLayout line, with the correct application name instead of xxxx:
xmlns:app="httx://schemas.android.com/apk/res/com.me.xxxx"
and:
<com.admob.android.ads.AdView
android:id="'at'+id/ad"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
app:backgroundColor="#000000"
apprimaryTextColor="#FFFFFF"
app:secondaryTextColor="#CCCCCC"
/>
As the above did not work I tried the following, but also without success:
AdView example_adview = (AdView) findViewById(R.id.ad);
example_adview.setVisibility(AdView.VISIBLE);
example_adview.requestFreshAd();
I would appreciate if someone could help me.
An off-topic question, when running my application (only this one) in ecplise (Windows), I always the device chooser, even though only my phone is connected and the emulator is not running. It's nothing that disturbs my development, but it's a bit annoying having to choose every time I run the application.
Thank you very much,
Kryex
I think this is caused by low fill rate of admob. If Admob didn't supply any ads for you to display, you got a empty ads.
High fill rate > more ads that are availabe to display.
and each time a user can 'view' ur ads, the fill rate increase.
Yes you don't always see ads because of low fill rate, also in Admob under add categories grown up ads (gambling etc NOT porn) are off by default, I switched those on and got a better fill rate.
Ha this method is good. Let me try on! Thanks for share!
your app needs to be out for atleast a couple of days and have a few hundred downloads at least before ads show up ALMOST every time... (hint: if you enable "age appropriate" ads you'll usually get more ads showing up)
I have poked and prodded in all sorts of config files, but how is Google hiding the Camera Icon/App/Launcher? Yes, I know the camera is still technically there, and can be accessed with one of many apps in the Play Store. But how is it being hidden? Here are the things I have tried, with no success:
Used Gallery.apk from another device (Nexus 4). Right after reboot, camera app was there for a few seconds, then went away.
Looked in the build.prop file. Don't see anything.
In "/system/etc/media_profiles.xml", I added <!ATTLIST EncoderProfile cameraId (0) #REQUIRED> after line 27.
In "/system/etc/permissions/android.hardware.camera.autofocus.xml", I added <feature name="android.hardware.camera" /> and <feature name="android.hardware.camera.autofocus" /> between the permissions tags.
In "/system/etc/permissions/", I added a file called "android.hardware.camera.autofocus.xml" with <feature name="android.hardware.camera.any" />, <feature name="android.hardware.camera" />, and <feature name="android.hardware.camera.autofocus" /> between the permissions tags.
Is it hardcoded in the gallery.apk, like "if device=grouper, then hide camera"? Does anyone know how the camera icon is being hidden?
Forget about it. Just use the app from the play store and forget about it.
Sent from my Nexus 4 using Tapatalk 2
scream4cheese said:
Forget about it. Just use the app from the play store and forget about it.
Sent from my Nexus 4 using Tapatalk 2
Click to expand...
Click to collapse
Clearly you did not read my post thoroughly.
Is there a rear-facing camera on your device? If not, GoogleGallery will disable camera app.
briankoko said:
Is there a rear-facing camera on your device? If not, GoogleGallery will disable camera app.
Click to expand...
Click to collapse
But how does it know that? Which config file is it looking at?
Sent from my Nexus 4 using Tapatalk 2
I'm guessing it's based on if the actual hardware is there. Noting to do with a configuration file.
That's just a guess though.
The Google shoppers app actually uses the camera and works
Sent from my HTC Raider X710e using xda app-developers app
rmkilc said:
I have poked and prodded in all sorts of config files, but how is Google hiding the Camera Icon/App/Launcher? Yes, I know the camera is still technically there, and can be accessed with one of many apps in the Play Store. But how is it being hidden? Here are the things I have tried, with no success:
Used Gallery.apk from another device (Nexus 4). Right after reboot, camera app was there for a few seconds, then went away.
Looked in the build.prop file. Don't see anything.
In "/system/etc/media_profiles.xml", I added <!ATTLIST EncoderProfile cameraId (0) #REQUIRED> after line 27.
In "/system/etc/permissions/android.hardware.camera.autofocus.xml", I added <feature name="android.hardware.camera" /> and <feature name="android.hardware.camera.autofocus" /> between the permissions tags.
In "/system/etc/permissions/", I added a file called "android.hardware.camera.autofocus.xml" with <feature name="android.hardware.camera.any" />, <feature name="android.hardware.camera" />, and <feature name="android.hardware.camera.autofocus" /> between the permissions tags.
Is it hardcoded in the gallery.apk, like "if device=grouper, then hide camera"? Does anyone know how the camera icon is being hidden?
Click to expand...
Click to collapse
Hi, rmkilc...
I'm going to go out on a huge speculative limb here (because I'm not a developer), but if I understand Android correctly, before we can directly interact with something in Android, it has to be defined as an 'Activity'...
http://developer.android.com/reference/android/app/Activity.html
http://www.mkyong.com/android/android-activity-from-one-screen-to-another-screen
---------------------
An 'activity', essentially, is just a 'window' through which we manipulate and use the app.
Many widgets (for example) don't have an 'activity'... they are just placed on the homescreen(s)... and cannot be opened directly from PlayStore once installed.
Such an example would be the Month Calendar Widget - http://play.google.com/store/apps/details?id=com.josegd.monthcalwidget&hl=en.
It cannot be opened directly as an app, in the way we would, say Angry Birds or Temple Run, because it has no defined 'activity'.
---------------------
Similarly, the camera, as a piece of hardware, has no software in the FACTORY/STOCK ROM that defines an 'activity' for it's use.
The MoDaCo Camera Launcher for Nexus 7 - http://play.google.com/store/apps/details?id=com.modaco.cameralauncher&hl=en accesses the camera via software that DOES define an 'activity' or 'window' through which we might interact with it.
---------------------
So, to conclude... and to summarise... And to answer your question...
It's not that the camera is hidden... it's just that there is no defined 'activity' via any app available in the FACTORY/STOCK ROM through which we might access it.
Rgrds,
Ged.
GedBlake said:
Hi, rmkilc...
I'm going to go out on a huge speculative limb here (because I'm not a developer), but if I understand Android correctly, before we can directly interact with something in Android, it has to be defined as an 'Activity'...
http://developer.android.com/reference/android/app/Activity.html
http://www.mkyong.com/android/android-activity-from-one-screen-to-another-screen
---------------------
An 'activity', essentially, is just a 'window' through which we manipulate and use the app.
Many widgets (for example) don't have an 'activity'... they are just placed on the homescreen(s)... and cannot be opened directly from PlayStore once installed.
Such an example would be the Month Calendar Widget - http://play.google.com/store/apps/details?id=com.josegd.monthcalwidget&hl=en.
It cannot be opened directly as an app, in the way we would, say Angry Birds or Temple Run, because it has no defined 'activity'.
---------------------
Similarly, the camera, as a piece of hardware, has no software in the FACTORY/STOCK ROM that defines an 'activity' for it's use.
The MoDaCo Camera Launcher for Nexus 7 - http://play.google.com/store/apps/details?id=com.modaco.cameralauncher&hl=en accesses the camera via software that DOES define an 'activity' or 'window' through which we might interact with it.
---------------------
So, to conclude... and to summarise... And to answer your question...
It's not that the camera is hidden... it's just that there is no defined 'activity' via any app available in the FACTORY/STOCK ROM through which we might access it.
Rgrds,
Ged.
Click to expand...
Click to collapse
Good points. The camera app or icon is part of the gallery (GalleryGoogle.apk on stock Android, Gallery2.apk on CM). Using the same gallery apk on a Nexus 4 and on a Nexus 7 results in the Nexus 4 showing the camera icon and the Nexus 7 not showing the camera icon. What I am trying to figure out is what part of the ROM is gallery looking at and deciding to hide the camera?
Code:
# am start -n com.google.android.gallery3d/com.android.camera.CameraActivity
seems to work, so it is certainly "in there" (the gallery app).
I suppose you could use baksmali to decompile /system/app/GalleryGoogle.{apk,odex} and poke around to find "why it is hidden".
there is something in there called
DisableCameraReceiver.smali
with a private method hasBackCamera() and (to the extent I understand .smali output) it disables the camera receiver based on whether or not the back camera is detected.
good luck
Not sure if this is interesting to anyone else or not looking for a harmony remote solution but..
Because you can control the Fire TV Stick over ADB: ( sigh.. can't post links, aftnews + how-to-remotely-control-an-amazon-fire-tv-or-fire-tv-stick-via-adb/ )
There are also a few more commands available which you can see here: ( search android KeyEvent ) (for media buttons mainly, but many interesting buttons that might come in handy on the stick)
My setup for this includes.. Logitech Harmony Remote using a Media Center IR receiver on an HTPC using Windows 7, and a Fire TV Stick
I made batch files for each of the remote commands, with an adb connect to the IP of the Stick just incase (it timesout after a while and if it's already connected it ignores the command). Then I setup AutoHotkey to look at my chosen remote commands, there is another autohotkey script that I use that tracks all button presses, so that you can just press the button on the remote and see the code to create a keybinding with. So now I have a script of all of the remote commands that I want which run the corresponding batch file. Then I setup one final script to turn on/off the keybinding script. I chose to use my Guide button to toggle this because I have no DVR in my HTPC anyway.
So the end result is that I can control my Fire TV stick via Harmony Remote -> IR Receiver on HTPC -> Autohotkey keybinding grabs the input when running -> Runs the ADB command for it. When I press Guide it goes into "Fire TV mode", and when I press it again it goes back to normal (so that I can control my HTPC again)
It's not the cleanest and there is a delay because the adb commands take about half a second to trigger, but it works and I'm satisfied for now. Because I haven't seen anyone else with a setup like this I thought I'd share. Just let me know if you want me to provide the scripts I have and go into more detail. I plan on refining it some too because I know next to nothing about batch files (I could probably just have one with different arguments, the only argument is the command number you want to send anyway) or autohotkey.
To the point: Anyone have any smart ideas to make the Netflix app visible to Kodi?
I bought my Nexus Player as a Kodi player to test the ability to launch android apps and hopefully get away from using PlayOn for Netflix and Hulu.
Unlike other android boxes, such as the Fire TV, I've noticed several android apps are hidden from other third party apps. Notably Netflix does not appear in either Chainfire's Sideload Launcher nor within Kodi in the Addons > Programs > Android Apps. So the app cannot be favorited. I tried using a StartAndroidActivity command with the correct apk name for Netflix "com.netflix.ninja" but that does nothing.
I'm rooted.
Much appreciation.
Does voice search --> "Go to Netflix" work for you?
habskilla said:
Does voice search --> "Go to Netflix" work for you?
Click to expand...
Click to collapse
I had to test it just now. It does however. That is a possible solution. Especially since I go straight to Kodi on startup with "XBMC Launcher".
I'd be interested however still if there was a solution, even convoluted or with some work, to make the app directly accessible from Kodi via key press.
I use the Eminence skin and do exactly like this guy, simply by adding the app as a favorite, then adding it to the start bar, works like a charm for native Android Netflix, WatchEspn, DishAnywhere, HBO GO all perfectly seamless and it drops me right back to the Kodi main screen when I exit.
http://youtu.be/PrRNqrZmFfE scroll forward to 5:58 to see launching apps.
I know there is a way to do this with other skins but Eminence makes it so simple, plus it looks great.
agwood said:
I use the Eminence skin and do exactly like this guy, simply by adding the app as a favorite, then adding it to the start bar, works like a charm for native Android Netflix, WatchEspn, DishAnywhere, HBO GO all perfectly seamless and it drops me right back to the Kodi main screen when I exit.
http://youtu.be/PrRNqrZmFfE scroll forward to 5:58 to see launching apps.
I know there is a way to do this with other skins but Eminence makes it so simple, plus it looks great.
Click to expand...
Click to collapse
And this works with the NP as well?
agwood said:
I use the Eminence skin and do exactly like this guy, simply by adding the app as a favorite, then adding it to the start bar, works like a charm for native Android Netflix, WatchEspn, DishAnywhere, HBO GO all perfectly seamless and it drops me right back to the Kodi main screen when I exit.
I know there is a way to do this with other skins but Eminence makes it so simple, plus it looks great.
Click to expand...
Click to collapse
Hey I appreciate it but that isn't really the problem. I'm familiar with the mechanics of adding android apps to various skin menus within Kodi.
That problem is that, unlike with Kodi on other android devices that I've used, on my Nexus player several apps (including Netflix and Pluto.tv) simply do not appear within other apps (including Kodi and Chainfire's Sideload Launcher). Netflix and Pluto.tv appear on the default launcher's home page and work perfectly. They can be launched via voice command and work perfectly. However within third party apps they do not appear at all.
So I've favorited several apps and added them to the home screen menu easily (Google Music and Hulu).
I would like to do the same with Netflix. However, the fact that it is hidden from within other apps prevents that. Does anyone know the mechanism behind which it some apps are hidden and what I might do to make Netflix visible from within other apps on the Nexus Player?
My sneaking suspicion is that the netflix app manifest only contains a leanback launcher activity and intent while other apps contain both leanback and normal intent (or only normal and are invisible to the leanback launcher). I plan to test this theory with a simple hello world application.
zlexy said:
My sneaking suspicion is that the netflix app manifest only contains a leanback launcher activity and intent while other apps contain both leanback and normal intent (or only normal and are invisible to the leanback launcher). I plan to test this theory with a simple hello world application.
Click to expand...
Click to collapse
Any solutions for this?
Also, Bueller? Bueller? Is this forum really debating things like the merits of an Ouya versus a Nexus Player versus whatever at length as compared to an actual technical problem like this?
txmed said:
Any solutions for this?
Also, Bueller? Bueller? Is this forum really debating things like the merits of an Ouya versus a Nexus Player versus whatever at length as compared to an actual technical problem like this?
Click to expand...
Click to collapse
Yep.
1] Download apktools (http://forum.xda-developers.com/showthread.php?t=2639400)
2] Extract the downloaded file anywhere in your pc
3] Copy the netflix apk to the "2-in" folder where you extracted APKTools
Note: I used EsFileExplorer to copy /data/app/com.netflix.ninja/base.apk to my PC
4]Double click on "Advanced ApkTool.exe" to start the tool
5] Select "2 - Decompile Files"
Note: the decompiled files will be be located in the "3-Out" folder
In the "3-Out" folder open AndroidManifest.xml using a text editor and below the line:
Code:
<category android:name="android.intent.category.LEANBACK_LAUNCHER"/>
add the following code:
Code:
<category android:name="android.intent.category.LAUNCHER"/>
6] Save AndroidManifest.xml and select "3 - Recompile" and recompile, sign and zipalign the files.
The recompiled apk will be inside "4-Done" folder
7] Uninstall netflix and re-install from the recompiled apk.
You can now run Netflix from XBMC and the sideload launcher.
zlexy said:
Yep.
You can now run Netflix from XBMC and the sideload launcher.
Click to expand...
Click to collapse
You're awesome. I wish I could buy you a beer.
Totally worked on Netflix and Pluto.tv.
Would the long-term solution be to update Kodi to look for leanback launcher intents when assigning favorites?
xBIGREDDx said:
Would the long-term solution be to update Kodi to look for leanback launcher intents when assigning favorites?
Click to expand...
Click to collapse
I submitted a simple fix to the Kodi dev forums.
AFAIK it was committed and should be in the nightly.
I wonder, how can I achieve this without modifying the apk? It would be cumbersome to update the package at each update.
I'm trying to launch netflix with Automate, so I can configure a package, activity and intent. This configuration currently works on my nexus tablet, but on the nexus player I get an error stating there's no app that can handle that. Image here imgur.com/BBgBmm7
Edit: nevermind, found the problem. Package for Android TV is com.netflix.ninja
zlexy said:
I submitted a simple fix to the Kodi dev forums.
AFAIK it was committed and should be in the nightly.
Click to expand...
Click to collapse
Did they do anything with your submission? I still can't get NextFlix to launch from within Kodi and it's annoying as heck. The new Plex launcher thing works great, I'm just missing the ability to launch NetFlix!
Hello,
The default 'Library' app on a NST & NST(G) ... is equipped to read pdf and epub files by default and list them out inside it.
As we already know the pdf files are not viewed best in the device's default reader app. The default library launches a pdf book into the default reader app.
I would like to know if somehow we can disable the library app from populating(picking-up) pdf files/books inside its library. This way i hope to get rid of pdf book entries from my default library.
is there some setting file for the default library app where we can uncheck pdf file format from its compatibility list ?
wouldn't it be nice to have a library full of only epub books ? would surely make our default library sparkling clean.
All Credit to @Renate NST ... for successfully accomplishing this idea to lighten up the default library app in our NST&G's ... to anybody who is interested in this ... can follow the steps found HERE
thanks for looking.
aiamuzz said:
Hello,
The default 'Library' app on a NST & NST(G) ... is equipped to read pdf and epub files by default and list them out inside it.
As we already know the pdf files are not viewed best in the device's default reader app. The default library launches a pdf book into the default reader app.
I would like to know if somehow we can disable the library app from populating(picking-up) pdf files/books inside its library. This way i hope to get read of pdf book entries from my default library.
is there some setting file for the default library app where we can uncheck pdf file format from its compatibility list ?
wouldn't it be nice to have a library full of only epub books ? would surely make our default library sparkling clean.
thanks for looking.
Click to expand...
Click to collapse
Not entirely sure about the Glowlight interface, but on the Library screen for the NST there is a drop-down menu option for displaying "all" or "books" or "shelves", etc. If you choose either "books" or "shelves" you will not see PDF files (unless you've included them in a shelf). That may be the easiest thing to do.
Installing a dedicated PDF reader will still give you access to any PDFs you may have via that app's user interface.
nmyshkin said:
Not entirely sure about the Glowlight interface, but on the Library screen for the NST there is a drop-down menu option for displaying "all" or "books" or "shelves", etc. If you choose either "books" or "shelves" you will not see PDF files (unless you've included them in a shelf). That may be the easiest thing to do.
Installing a dedicated PDF reader will still give you access to any PDFs you may have via that app's user interface.
Click to expand...
Click to collapse
@nmyshkin ... good work man ... you've kept our dinosaur of a device alive by your participation and chatter(enthusiasm) ... the community owes you among ... the many others who have from time to time kept the activity around our devices alive this far.
Yeah i am aware of the "all", "books" or "shelves" categorizations ... currently i use the shelves to minimize the cluttered library with the pdf's littered around without much use there as the nook reader is not the best reader for pdf's.
The reason i hope the PDF's do not show up even in the "All" category is because i have a lot of PDF's on my memory card, they all get populated in the default library app and unnecessarily increase the painful number of pages one has to flip through to get to a particular epub ebook burried under it.
If this could be achieved then ... preferred app per format would be ...
mobi format : Kindle
epub format : nook reader (without the clutter of the PDF files in its library)
pdf format :
ebookdroid - for a clean page flip reading experience of a fixed width PDF layout.
AVP pdf reader - for a magazine(multi-column) layout
... where double tapping a particular column in both, zooms in on the content to a readable size.
just hoping the PDF format could be unchecked from the default library app all together.
PS : i remember having the 'reboot' and 'recovery' options besides the 'power off' option before i reconfigured my NSTG lately, i just forgot how to enable the same back, Would appreciate if somebody could jog my memory on how to re-enable it back.
Power menu mod: https://forum.xda-developers.com/showthread.php?t=2171818
Can you tell me the version number for AVP PDF reader?
There are two different things here:
The first is the preferred activity for .pdf (or .epub or anything).
That's a question of whether you have another app to support it and whether you selected it in the picker.
The second thing is whether the Nook library notices and records .pdf items.
It's been a long time since I used any of the stock Nook library or reader.
In the NST, you could modify com.bn.nook.util.ReaderUtils.isSupportedFormat() to report false for pdf.
I believe that you would have to resign your whole system as the old Nook used sharedIds instead of priv-app
In the latest Nook (Glow3), you could modify com.nook.scanner.ScannerService.isNookSupported() to report false for pdf.
You could also just hack the database to delete all the pdfs.
An After Insert Trigger would do the job.
Unfortunately, I have no populated B&N databases to demonstrate this.
Renate NST said:
There are two different things here:
The second thing is whether the Nook library notices and records .pdf items.
It's been a long time since I used any of the stock Nook library or reader.
In the NST, you could modify com.bn.nook.util.ReaderUtils.isSupportedFormat() to report false for pdf.
I believe that you would have to resign your whole system as the old Nook used sharedIds instead of priv-app
'
'
You could also just hack the database to delete all the pdfs.
An After Insert Trigger would do the job.
Unfortunately, I have no populated B&N databases to demonstrate this.
Click to expand...
Click to collapse
thanks @Renate NST ...
Yup i am looking at the second option where the library does not notice pdf files ...
will reporting 'com.bn.nook.util.ReaderUtils.isSupportedFormat()' as false, render the library unable to record pdf files ?
If so ... a noob instruction set ... on how one could go about reporting the ...isSupportFormat to false ?
and about hacking the database to delete all the pdf's ... we will have carry out the deleting exercise everytime one adds new pdf files or reboots the nook ... that would be cumbersome.
look forward to the sought instruction set to report supported format as false ...
thanks.
nmyshkin said:
Power menu mod: https://forum.xda-developers.com/showthread.php?t=2171818
Can you tell me the version number for AVP PDF reader?
Click to expand...
Click to collapse
thanks for the link ... @nmyshkin ...
I am using version 2 versions ...
APV PDF Viewer 0.4.1.0 (41001)
found the following entries in 'LibraryPreferences.xml'
Code:
<?xml version='1.0' encoding='utf-8' standalone='yes' ?>
<map>
<int name="view_type_2" value="4" />
<int name="view_type_0" value="0" />
<int name="media_type" value="5" />
<int name="sort_type_4" value="0" />
<int name="sort_type_5" value="0" />
<int name="view_type_7" value="0" />
<int name="view_type_5" value="0" />
<int name="view_type_4" value="2" />
</map>
any values to be modified here to disable PDF file type ?
aiamuzz said:
found the following entries in 'LibraryPreferences.xml'
Code:
<?xml version='1.0' encoding='utf-8' standalone='yes' ?>
<map>
<int name="view_type_2" value="4" />
<int name="view_type_0" value="0" />
<int name="media_type" value="5" />
<int name="sort_type_4" value="0" />
<int name="sort_type_5" value="0" />
<int name="view_type_7" value="0" />
<int name="view_type_5" value="0" />
<int name="view_type_4" value="2" />
</map>
any values to be modified here to disable PDF file type ?
Click to expand...
Click to collapse
My guess is no. The values in my file are slightly different and I'd hazard a guess that these apply to the current state of the drop-down menus in the library.
aiamuzz said:
... everytime one adds new pdf files or reboots the nook ... that would be cumbersome.
Click to expand...
Click to collapse
No, a trigger would act on the insert automatically and delete or disable it immediately.
The other approach to modify the code, try using apktool.
I know that it's a bit cumbersome to rebuild apk's, but you might find it a useful skill to learn.
Code:
apktool d whatever.apk
<modify something>
apktool b whatever.apk
<sign using jarsigner and your signature>
Unfortunately, you have an NST which requires resigning *everything*.
Renate NST said:
No, a trigger would act on the insert automatically and delete or disable it immediately.
The other approach to modify the code, try using apktool.
I know that it's a bit cumbersome to rebuild apk's, but you might find it a useful skill to learn.
Code:
apktool d whatever.apk
<modify something>
apktool b whatever.apk
<sign using jarsigner and your signature>
Unfortunately, you have an NST which requires resigning *everything*.
Click to expand...
Click to collapse
hmmmm ... looks way above my pay grade currently ... reverse engineering an apk that is !!!
PS : I have decompiled the library app and extracted the java source codes ... i tried to read the smali files and java files ... shortlisted two files that could possibly hold the key to accomplish the desired functionality ... but that's about it ... i currently do not possess the skill to modify and rebuild the Library apk. I can post the smali files if anybody wants to help modify the relevant parts of code.
Renate NST said:
There are two different things here:
'
'
'
You could also just hack the database to delete all the pdfs.
An After Insert Trigger would do the job.
Unfortunately, I have no populated B&N databases to demonstrate this.
Click to expand...
Click to collapse
Could a more detail instruction on how to attempt the database hack ... possible ?
thanks
Well, let's try an easy test first.
I fired up my old NST to take a look.
I don't have the B&N reader or library on it, so I don't know if this will do the job.
Try this:
Code:
# cd /data/data/com.bn.nook.reader.activities/databases
# ls
...
readerlocal.db
...
# sqlite3 readerlocal.db
sqlite> select ean from readerlocal where ean like '%.pdf';
... <bunches of pdf files>
sqlite> delete from readerlocal where ean like '%.pdf';
sqlite> .q
#
Then do a restart and see if the stuff is missing from the library and how long it takes B&N to put it all back.
If this clears it out of the library, fine, we can work on the automatic trigger.
Renate NST said:
Well, let's try an easy test first.
I fired up my old NST to take a look.
I don't have the B&N reader or library on it, so I don't know if this will do the job.
Try this:
Code:
# cd /data/data/com.bn.nook.reader.activities/databases
# ls
...
readerlocal.db
...
# sqlite3 readerlocal.db
sqlite> select ean from readerlocal where ean like '%.pdf';
... <bunches of pdf files>
sqlite> delete from readerlocal where ean like '%.pdf';
sqlite> .q
#
Then do a restart and see if the stuff is missing from the library and how long it takes B&N to put it all back.
If this clears it out of the library, fine, we can work on the automatic trigger.
Click to expand...
Click to collapse
This seemed to be working at the time of execution (although there is no feedback when files are "deleted"?), but it did not list all PDF files. I recently downloaded a copy of the newspaper in PDF form and that is in the Library. This was not listed by sqlite. Instead, long gone items were listed.
In any case, when I exited and rebooted, the newspaper was still in the Library (or "back"). When I was writing the book cover "screensaver" app, there was another db besides readerlocal which seemed to contain similar info but I've forgotten what it was.
nmyshkin said:
Instead, long gone items were listed.
Click to expand...
Click to collapse
Well, then it's just using the regular MediaScanner.
If you hack that then a PDF viewer that relies on it may not enumerate PDF's.
Of course you can still select a PDF in a file manager and open it in your viewer.
As I said, I have neither a B&N Reader nor B&N assets on any of my devices.
Ok, try this one:
Code:
# cd /data/data/com.android.providers.media/databases
# sqlite3 internal.db
sqlite> select _data from docs;
...
sqlite> select _data from docs where _data like '%.pdf';
...
sqlite> update docs set valid=0 where _data like '%.pdf';
sqlite> .q
#
Renate NST said:
Well, then it's just using the regular MediaScanner.
If you hack that then a PDF viewer that relies on it may not enumerate PDF's.
Of course you can still select a PDF in a file manager and open it in your viewer.
As I said, I have neither a B&N Reader nor B&N assets on any of my devices.
Ok, try this one:
Code:
# cd /data/data/com.android.providers.media/databases
# sqlite3 internal.db
sqlite> select _data from docs;
...
sqlite> select _data from docs where _data like '%.pdf';
...
sqlite> update docs set valid=0 where _data like '%.pdf';
sqlite> .q
#
Click to expand...
Click to collapse
OK, so this listed the entire library contents, including the one current PDF file. I guess it also accepted the final command (no feedback), but when I rebooted, the PDF was still (or back) in the Library. I also checked the Library just before rebooting and the PDF was still there.
nmyshkin said:
... the PDF was still there.
Click to expand...
Click to collapse
Yeah, I was just trying to see if the B&N stuff paid attention to the "valid" column, apparently not.
OTOH, if you only have one PDF, why is this such an issue???
Code:
# cd /data/data/com.android.providers.media/databases
# sqlite3 internal.db
sqlite> delete from docs where _data like '%.pdf';
sqlite> .q
#
Renate NST said:
Yeah, I was just trying to see if the B&N stuff paid attention to the "valid" column, apparently not.
OTOH, if you only have one PDF, why is this such an issue???
Click to expand...
Click to collapse
LOL, actually, I'm not the OP! But I was curious to see if such a manipulation was possible. I still think it is simplest to just choose the display "Books" or "Shelves" in the Library. That way you don't see PDFs unless you specifically put them on a shelf. Meanwhile your dedicated PDF app can be directed to the PDF files.
Renate NST said:
Code:
# cd /data/data/com.android.providers.media/databases
# sqlite3 internal.db
sqlite> delete from docs where _data like '%.pdf';
sqlite> .q
#
Click to expand...
Click to collapse
This instruction removes the PDF file from the Library immediately, or as fast as I can get there after closing the terminal window.
The PDF file reappears in the Library on reboot, as you might expect. Like I said, I think it's just simpler to choose a Library display option that excludes PDF files. Something by Emerson regarding a foolish consistency
nmyshkin said:
Something by Emerson regarding a foolish consistency
Click to expand...
Click to collapse
Well, the (artifical) constraints on this were to do it without modifying the apk.
Code:
CREATE TRIGGER no_pdfs AFTER INSERT ON docs BEGIN DELETE FROM docs WHERE _data LIKE '%.pdf'; END;
That's it, put it in your database.