Related
The B&N Home application lets you add B&N-purchased books to the home screen and arrange/resize them arguably better than most generic android launchers. Unfortunately this doesn't work for sideloaded books. This is most definitely not because it can't be done, but likely as an incentive for you to purchase books from B&N and not sideload. The following describes the sqlite3 database entries necessary to manually add sideloaded books (and potentially other things) to this home screen.
Warning: Changes should not be attempted by someone not at least somewhat familiar with adb and sqlite3. This is not intended as a how-to for adding sideloaded books to the home screen (since it is tedious, and not something you'd likely do often manually), but more as a reference for someone to perhaps develop an android app for the NC to do so on-device. If you don't use the B&N Home at all and use the device more as a tablet than an e-reader, you can completely ignore this post.
Relevant databases:
/data/data/com.bn.nook.home/files/home.db - Contains the home screen 'workspace' table with entries for each item on the home screen.
/data/data/com.bn.nook.reader.activities/databases/lastreadingpoint.db - Contains the 'lastreadingpoint' table which records the last read position for all books (B&N and sideloaded).
/data/data/com.android.providers.media/databases/internal.db - Android 'media' provider database containing content entries for books (among other things). Heavily modified by B&N.
home.db, workspace table
Schema:
Code:
CREATE TABLE workspace (_id TEXT PRIMARY KEY, thumbnail_url TEXT, cover_image_url TEXT, ean TEXT, title TEXT, author TEXT, desktop_num INT NOT NULL, left INT NOT NULL, top INT NOT NULL, right INT NOT NULL, bottom INT NOT NULL, rotate_degree FLOAT NOT NULL, lending_state INT NOT NULL, is_lendable BOOLEAN NOT NULL, is_recommended BOOLEAN NOT NULL, is_new BOOLEAN NOT NULL, is_sample BOOLEAN NOT NULL, launcher_type TEXT, product_type INT NOT NULL, product_ean TEXT, is_hidden BOOLEAN NOT NULL DEFAULT FALSE, path_to_file TEXT);
Fields:
_id - Android content link to the book.
Examples: content://media/internal/products/1 (B&N book), content://media/internal/docs/1 (sideloaded book)
thumbnail_url - Thumbnail image location. Note that sideloaded use non-browser paths. File:// paths do not appear to work in this field.
Examples: http: //images.bn.com/images/85750000/85751898.JPG (B&N Book), /media/.docThumbs/Quick_Startepub.jpg (sideloaded book)
cover_image_url - Cover image location. Same format as thumbnail. Same image even, for sideloaded books.
Examples: http ://images.bn.com/images/85750000/85754280.JPG (B&N Book), /media/.docThumbs/Quick_Startepub.jpg (sideloaded book)
ean - B&N unique identifier, for B&N Books. File location in browser format (file:///media/...) for sideloaded books. Note this must match what's in lastreadingpoint.db for the last reading point to be correct when tapping the book to open it.
Examples: 9781402786402 (B&N Book), file:///system/media/books/Quick_Start.epub (sideloaded book)
title, author - Self explanitory. Plain text. Appear to be unused unless the images are not found, in which case the title is truncated and overlaid on a generic gray icon.
desktop_num - Which desktop the icon appears on. 0,1, or 2 with 1 being the default.
left, top, right, bottom - Pixel measurements for the corners of the icons. Determines the location and size of the icon on the home screen.
rotate_degree - Haven't played with this one yet.
lending_state - Current state of lendable book. Haven't investigated valid values other than the default 0.
is_lendable, is_recommended, is_new, is_sample - Flags that determine what 'banner' is displayed, and also what opens show on tap-and-hold.
launcher_type - Launcher to open the book with.
Valid values: blank (epub), epub, epib (children's books). Things still to try: html, pdf...
product_type - Type of book.
1 = B&N book, 0 = Sideloaded book.
product_ean - Appears to always match ean field.
is_hidden - Hide's icon? Haven't tried.
path_to_file - Filesystem path to book.
Examples: /media/B&N Downloads/Books/9781402786402_ePib.v2.epub (B&N Book), /system/media/books/QuickStart.epub (sideloaded book)
lastreadingpoint.db, lastreadingpoint table
Schema:
Code:
CREATE TABLE lastreadingpoint (_id integer primary key autoincrement, ean text , luid text , offsetrmsdk text , lastupdated long , bookdna int , sync_status int);
Relevant Field:
ean - B&N unique identifier, for B&N Books. File location in browser format (file:///media/...)for sideloaded books. Note this must match what's in home.db for the last reading point to be correct when tapping the book to open it.
internal.db, products/docs tables
Schema:
Code:
CREATE TABLE products (_id INTEGER PRIMARY KEY,ean TEXT NOT NULL UNIQUE,_data TEXT,_size INTEGER,product_type INTEGER NOT NULL,mime_type TEXT,_display_name TEXT,product_code TEXT NOT NULL,format_code TEXT NOT NULL,purchase_status TEXT NOT NULL,title TEXT NOT NULL,authors TEXT NOT NULL,mainAuthorFirstName TEXT,mainAuthorMiddleName TEXT DEFAULT NULL,mainAuthorLastName TEXT NOT NULL,publisher TEXT NOT NULL,date_published INTEGER NOT NULL,date_added INTEGER NOT NULL,date_modified INTEGER,date_last_accessed INTEGER DEFAULT 0,thumb_image TEXT,cover_image TEXT,rating INTEGER DEFAULT 0, user_rating INTEGER DEFAULT 0, subscription_ean TEXT DEFAULT NULL,isSubscription BOOLEAN DEFAULT 0,isSample BOOLEAN DEFAULT 0,locker_delivery_id INTEGER NOT NULL,locker_status TEXT NOT NULL, short_synopsis TEXT,storage_location INTEGER DEFAULT 1,isNew INTEGER DEFAULT 0,lendable BOOLEAN DEFAULT 0,lending_state TEXT,lendee TEXT,lender TEXT,lend_message TEXT,lend_id TEXT,lend_offer_expires INTEGER,lend_starts INTEGER,lend_ends INTEGER,category TEXT,luid TEXT NOT NULL,sync_status INTEGER DEFAULT 0,page_count INTEGER,rating_count INTEGER, local_thumb_image TEXT, local_cover_image TEXT, ebook_key TEXT, launcher_type TEXT, isDownloadable INTEGER DEFAULT 1, productEAN TEXT, isComingSoon INTEGER, DeliveryFrequency INTEGER, seriesTitle TEXT, soldBy TEXT, trialExpirationDate INTEGER );
Code:
CREATE TABLE docs (_id INTEGER PRIMARY KEY,ean TEXT,_data TEXT,_size INTEGER,product_type INTEGER,mime_type TEXT,_display_name TEXT,title TEXT,authors TEXT,mainAuthorFirstName TEXT,mainAuthorMiddleName TEXT DEFAULT NULL,mainAuthorLastName TEXT,publisher TEXT,date_added INTEGER,date_modified INTEGER,date_published INTEGER,date_last_accessed INTEGER DEFAULT 0,valid INTEGER,thumb_image TEXT,cover_image TEXT,rating INTEGER DEFAULT 0, user_rating INTEGER DEFAULT 0,storage_location INTEGER DEFAULT 0,category TEXT,page_count INTEGER, launcher_type TEXT, volume_id INTEGER DEFAULT 0);
Relevant Fields:
_id - The content id needed for the _id field in home.db workbook table.
thumb_image - Thumbnail image location. Note that sideloaded use non-browser paths. File:// paths do not appear to work in this field.
Examples: http ://images.bn.com/images/85750000/85751898.JPG (B&N Book), /media/.docThumbs/Quick_Startepub.jpg (sideloaded book)
cover_image - Cover image location. Same format as thumbnail. Same image even, for sideloaded books.
Steps to add sideloaded content via adb:
Pull all relevant tables from the device using adb.
Look up relevant database entries (content id, images, etc)
Use sqlite3 to add or modify entries in home.db, workspace table.
Example:
Code:
INSERT INTO workspace VALUES('content://media/internal/docs/3', '/media/.docThumbs/TestBook.jpeg', '/media/.docThumbs/TestBook.jpeg', 'file:///media/My Files/Books/TestBook.epub', 'Test Book', 'Test Author', 1, 20, 20, 184, 232, 0.0, 0, 0, 0, 0, 0, 'epub', 0, 'file:///media/My Files/Books/TestBook.epub', 0, '/media/My Files/Books/TestBook.epub');
Push home.db back to the NC.
Kill the Home process via shell or a process manager app.
Open Home again.
Notes:
12/29/10
Sideloaded books must be opened at least once to populate all the databases. This poses a potential problem for trying to do this at sideload time, ie through a calibre plugin.
The _id field of workspace does not appear to have to be correct for icons to function normally. My first tests had a generic 'test1' in that field until I figured out where to look for the correct value and I was able to open sideloaded books just fine with the resulting icon. This fact, along with the fact that image locations can be guessed correctly may mean we can do this at sideload time after all.
The User Guide and Quick Start are decent examples of sideloaded content on the B&N Home screen. The only oddities with them are blank ean fields, so last read position is not used when opening them.
I've seen some oddities where the icons don't render images until you touch one of them on the screen after the Home app launches. Haven't tracked down the cause yet, and it doesn't happen every time.
Setting a sideloaded book as lendable adds the 'Lend' option to the tap-and-hold, but it doesn't appear to do anything after you enter the contact. My guess is they verify this status either with their servers (likely), or with another on-device database (doubtful) .
Sideloaded books can be removed from the home screen as normal, by doing a tap-and-hold and choosing Remove.
very nice work
I can't help anyway with this but I'm glad someone's trying to fix this problem.
Wow, nice work! I'm hoping someone with more experience than me can write this into an app.
I actually really like the BN home screen, so maybe for I'll give this a try for my textbooks. I'll need them all semester, so it would probably be worth it.
Addendum: I wonder if it would be possible to make this process easier my first adding the books and the relevant thumbnails to the home screen via the process described here and then editing the database entry to remove the is_sample tag.
im gonna give this a try, but moreso, im gonna look at ADWLauncher, to see if i can add this to that launcher
Maybe I was too tired, but in my poking around (and your post) I didn't see anything about the "shelves" feature in the schema for these db. You have any ideas?
usernotfound said:
Maybe I was too tired, but in my poking around (and your post) I didn't see anything about the "shelves" feature in the schema for these db. You have any ideas?
Click to expand...
Click to collapse
Shelves are more a feature of the Library app than the Home app, so I haven't investigated them. There are tables in internal.db having to do with shelves, so I would look there first, as well as /data/data/com.bn.nook.library.
How about launching books
Any idea on how to launch a book with the B&N software? I would assume there is some kinda intents that could be used if documented to do that.
Would be nice for say a replacement home app to be able to launch books..
I've been able to (manually) create shortcuts in adw launcher to launch books using the B&N reader (as well as a few others like Aldiko, etc.). The intent (column in the adw db) that seemed to work for the B&N reader looked something like this:
Code:
file:///media/My Files/Books/Some-Book-Filename.epub#Intent;action=android.intent.action.VIEW;component=com.bn.nook.reader.activities/.ReaderActivity;end
One thing the BN Home does is initialize open-book-icon in the status bar ... to point to the 'currently reading' book. This icon doesn't work if an alternate launcher is set to default upon boot.
I'd love to get that currently-reading icon to work in alternate launchers, but I'm not sure where to begin. Any thoughts?
WhiskeySlx said:
I'd love to get that currently-reading icon to work in alternate launchers, but I'm not sure where to begin. Any thoughts?
Click to expand...
Click to collapse
This is unlikely to be trivial. As far as I can tell that icon is updated as long as the B&N home app is running in the background, even if you don't ever open it again. This likely means there is some communication between the B&N reader app and the home app to update the icon. Getting the reader app to somehow communicate with another app or launcher would almost certainly require decompiling and modifying it.
[mods, please move this to a new thread if this is too OT]
Rayven01 said:
Getting the reader app to somehow communicate with another app or launcher would almost certainly require decompiling and modifying it.
Click to expand...
Click to collapse
I wonder if the Nook reader app might expose an 'action' that matches that button's functionality. I'm thinking about how, using ADW, you can create custom shortcuts... and under "Activities", ADW lists activities for each app... for example:
- Gmail.ComposeActivity
- Market.UninstallActivity
- com.google.android.maps.PlacesActivity
I don't know what method it uses to build that list, but... maybe it's a direction to pursue?
This is 2 really simple apps and it creates 2 shortcuts off the start menu to them.
One to Stop Sense and the other to Start Sense.
(It does not do anything with any other Today Item. Titanium is a Today Item. It will not stop or start Titanium.)
Purpose - Stop Sense does exactly that, which makes more memory available. I see 110 MB available when Sense is not running. I start Sense, and there is 75 MB available. Sense will continue to eat up more memory as you use different tabs. Stopping it and starting it will return alot of this memory.
I attached the source code to post #2.
Icons by Lechux posted here: http://forum.xda-developers.com/showpost.php?p=5887883&postcount=1 as the Firestorm Iconset.
Pointed out to me by Joe Bleau posted here: http://forum.xda-developers.com/showpost.php?p=11197629&postcount=32967
where he gave proper reference to the original and made a 2nd one with the other color.
This app is very simple, but if you find it useful, please thank the post.
Source Code
Attached here is the entire project with source code to build it.
Things that can be learned from the source code
How to use functions defined in core.dll.
How to use PostMessage.
How to write to the registry.
How to write an app with no user interface.
How to create a cab
How to include multiple targets in 1 cab.
If you learn something from this, or find it useful, please thank the post.
File where all the work is done SenseState.cs:
Code:
using System;
using System.Collections.Generic;
using System.Text;
using System.Runtime.InteropServices;
using Microsoft.Win32;
namespace StopSense_JVH3
{
class SenseState
{
[DllImport("coredll.dll")]
private static extern int SendMessage(IntPtr hWnd, uint msg, int wParam, int lParam);
[DllImport("coredll.dll")]
private static extern bool PostMessage(IntPtr hWnd, uint msg, int wParam, int lParam);
public const int HWND_BROADCAST = 0xffff;
public const int WM_WININICHANGE = 0x001A;
public static void StartSense()
{
try
{
RegistryKey RegKey = Registry.LocalMachine.OpenSubKey(@"Software\Microsoft\Today\Items\HTC Sense", true);
if (RegKey != null)
{
RegKey.SetValue("Enabled", 1);
RegKey.Close();
}
PostMessage((IntPtr)HWND_BROADCAST, WM_WININICHANGE, 0xF2, 0);
}
catch (Exception someEx)
{
string s = someEx.Message;
int i = 0;
i++;
}
}
public static void StopSense()
{
try
{
RegistryKey RegKey = Registry.LocalMachine.OpenSubKey(@"Software\Microsoft\Today\Items\HTC Sense", true);
if (RegKey != null)
{
RegKey.SetValue("Enabled", 0);
RegKey.Close();
}
PostMessage((IntPtr)HWND_BROADCAST, WM_WININICHANGE, 0xF2, 0);
}
catch (Exception someEx)
{
string s = someEx.Message;
int i = 0;
i++;
}
}
}
}
Then it is called in Program.cs
Code:
using System;
using System.Collections.Generic;
using System.Text;
namespace StopSense_JVH3
{
class Program
{
static void Main(string[] args)
{
SenseState.StopSense();
}
}
}
Thanks. Would it be hard to add a reset shortcut too?
Reserving Post
Just in case, but the app is so simple I can't imaging a need for this yet.
mwalt2 said:
Thanks. Would it be hard to add a reset shortcut too?
Click to expand...
Click to collapse
There is already a reset shortcut to reset the phone.
And a Sense Reset also already exists.
JVH3 said:
There is already a reset shortcut to reset the phone.
And a Sense Reset also already exists.
Click to expand...
Click to collapse
I know it already exists. I was just thinking it could be an all-in-one solution (start, stop, reset).
Frozen on NRG Splash Screen
I'm sorry to report that I have a spare Titlt 2 that I hard resetted this afternoon to make default Home screen captures for your app, running Energy.RHODIUM.28244.Sense2.5.Cookie.2.0.Feb.01 w/o any mods nor apps except Whip2Snap to make screen captures and w/o SIM.
I installed StartStopSense_JVH3_v1001.CAB while I was in Titanium mode (Sense stopped) & when I clicked on Start Sense, nothing was happening. I restarted the phone for good measure, same results. I then started Sense via Start > Settings > Home > Items and then tried Stop Sense. The phone froze on the splash screen before normally Starting Sense text appears. I soft resetted twice and both times I got: Mainsplash > animation > NRG/HTC Quietly Brilliant > No SIM warning & black dialer (emergency calls only) & after waiting a while, pressing End brings me to the same NRG splash (see screen capture below), never getting to Home. The End hardware button does not bring up Home.
Only Start works but Start > Home does not work. Start > Settings > Remove program StartStopSense_JVH3_v1001.CAB worked but still no Home!
Soft reset: still no Home, stuck on NRG's splash screen and End hardware button does not bring up Home. Only solution I could think of is to hard reset.
If you want to try StartStopSense_JVH3_v1001.CAB, I strongly suggest that you backup your settings & data first.
Edit: Start > Whip2Snap worked so I took this screen capture before hard resetting:
Hard reset was not necessary / source code and full project is in post #2
Joe Bleau said:
I'm sorry to report that I have a spare Titlt 2 that I hard resetted this afternoon to make default Home screen captures for your app, running Energy.RHODIUM.28244.Sense2.5.Cookie.2.0.Feb.01 w/o any mods nor apps except Whip2Snap to make screen captures and w/o SIM.
I installed StartStopSense_JVH3_v1001.CAB while I was in Titanium mode (Sense stopped) & when I clicked on Start Sense, nothing was happening. I restarted the phone for good measure, same results. I then started Sense via Start > Settings > Home > Items and then tried Stop Sense. The phone froze on the splash screen before normally Starting Sense text appears. I soft resetted twice and both times I got: Mainsplash > animation > NRG/HTC Quietly Brilliant > No SIM warning & black dialer (emergency calls only) & after waiting a while, pressing End brings me to the same NRG splash (see screen capture below), never getting to Home. The End hardware button does not bring up Home.
Only Start works but Start > Home does not work. Start > Settings > Remove program StartStopSense_JVH3_v1001.CAB worked but still no Home!
Soft reset: still no Home, stuck on NRG's splash screen and End hardware button does not bring up Home. Only solution I could think of is to hard reset.
If you want to try StartStopSense_JVH3_v1001.CAB, I strongly suggest that you backup your settings & data first.
Edit: Start > Whip2Snap worked so I took this screen capture before hard resetting:
Click to expand...
Click to collapse
The app only stops sense and starts sense.
It does not stop Titanium (Windows Default) and it does not start Titanium.
I have stopped and started sense several times with it.
You realy didn't need to hard reset. I published the source code in post #2.
You can see that all running it does is modify 1 registry entry. Then sends a message using PostMessage so that windows will be notified of the change.
If you would have just used Start->Settings->Today->Items and selected the option that you wanted, you would have been able to correct anything without a hard reset.
Or to just have run Start Sense.
Titanium (Windows Default) is a today plugin. The app does not toggle between Titanium and Sense, it only stops sense and starts sense.
The image you posted is almost exactly what I see when I stop sense.
Then I use the Start Sense app to start sense, and Sense Starts.
Start Sense is not designed to stop any other today items, such as Windows Default, before starting sense.
Idea for new version
Make it more general
New version should be renamed to Stop Today Items / Start Today Items / Start Sense / Start Titanium
Stop Today Items (Biggest Memory Savor)
Stop all today items, such as Sense or Titanium or any others, recording which ones it stopped.
Start Today Items
Stop any running today items.
Start all today items that Stop Today Items had stopped.
Start Sense
Stop all today items. Start Sense.
start Titanium (Saves memory, but it is a today item, so it does consume some.)
Stop all today items. Start Titanium (Windows Default).
I'll need some more icons. Please post pngs.
Start & Stop Sense
I want to thank you JVH3, for your support.
Even being apparently simple, as you wrote, for me it was a pain going all the way through menus to start and stop sense everytime I wanted to play a movie or use GPS.
People like you, Joe Bleau and others, not forgeting NRGZ28, that support this development are the ones that will keep this excelent smartphone alive for a long time.
I have waited a long time to dive into this ROM. I could not afford having issues with my work tool.
I have been following this thread for quite some time and could see all the effort you all put into it.
Last week, reading the posts, I figured out that it was stable enough to flash it in my TP2.
And it really is amazing.
The only issue I had so far is a screen freezing (the phone keeps receiveing calls) when I go inside some configuration menus, like sounds. But I only do that on my spare time.
I did not use TASK29 (I didn´t understand how to use it) I had the original WWE stock ROM that came with it from htc. I bought an unlocked TP2 from Amazon.
Probably when I wipe it all with Task29 this issue disappears. I haven´t read any report with an issue like that.
I´ll keep you posted when I do that.
Thanks again
costinhas.
Brazil.
Possible problem?
Here is all that I did today which led me to my problem:
1. Switched from Panel start menu to Normal start menu
2. Installed MMAppLauncher from here
3. Selected override start menu option in the app above
4. Installed StartStopSense app
Sense is stopped just fine. But when I try to restart it, I get the never ending loop of "Tap here to launch..." and "Launching HTC Sense." A search reveals that this problem might be a common one across different situations. What I don't know is whether its the MMAppLauncher or StartStopSense that is the possible culprit.
Any ideas?
bipinsen said:
Here is all that I did today which led me to my problem:
1. Switched from Panel start menu to Normal start menu
2. Installed MMAppLauncher from here
3. Selected override start menu option in the app above
4. Installed StartStopSense app
Sense is stopped just fine. But when I try to restart it, I get the never ending loop of "Tap here to launch..." and "Launching HTC Sense." A search reveals that this problem might be a common one across different situations. What I don't know is whether its the MMAppLauncher or StartStopSense that is the possible culprit.
Any ideas?
Click to expand...
Click to collapse
This app is not responsible for any sense restart loop.
My guess is that you are using Cookie 2.0 and have the Task widget on your homescreen, but no tasks to display. It's a common problem with Cookie 2.0.
Common fix found in that thread is to:
Stop Sense
add a task through the windows interface to tasks. With an energy ROM: Action->Task
Start Sense
--------------------------------------------
Literally, these app (Start Sense / Stop Sense ) change 1 registry entry when run.
Start Sense does this
[HKLM\Software\Microsoft\Today\Items\HTC Sense]
Enabled=1
Stop Sense does this
[HKLM\Software\Microsoft\Today\Items\HTC Sense]
Enabled=0
After that, each apps does this:
PostMessage((IntPtr)HWND_BROADCAST, WM_WININICHANGE, 0xF2, 0);
That just tells the operating system that something changed. The operating system is responsible for everything beyond that.
Code:
using System;
using System.Collections.Generic;
using System.Text;
using System.Runtime.InteropServices;
using Microsoft.Win32;
namespace StopSense_JVH3
{
class SenseState
{
[DllImport("coredll.dll")]
private static extern int SendMessage(IntPtr hWnd, uint msg, int wParam, int lParam);
[DllImport("coredll.dll")]
private static extern bool PostMessage(IntPtr hWnd, uint msg, int wParam, int lParam);
public const int HWND_BROADCAST = 0xffff;
public const int WM_WININICHANGE = 0x001A;
public static void StartSense()
{
try
{
RegistryKey RegKey = Registry.LocalMachine.OpenSubKey(@"Software\Microsoft\Today\Items\HTC Sense", true);
if (RegKey != null)
{
RegKey.SetValue("Enabled", 1);
RegKey.Close();
}
PostMessage((IntPtr)HWND_BROADCAST, WM_WININICHANGE, 0xF2, 0);
}
catch (Exception someEx)
{
string s = someEx.Message;
int i = 0;
i++;
}
}
public static void StopSense()
{
try
{
RegistryKey RegKey = Registry.LocalMachine.OpenSubKey(@"Software\Microsoft\Today\Items\HTC Sense", true);
if (RegKey != null)
{
RegKey.SetValue("Enabled", 0);
RegKey.Close();
}
PostMessage((IntPtr)HWND_BROADCAST, WM_WININICHANGE, 0xF2, 0);
}
catch (Exception someEx)
{
string s = someEx.Message;
int i = 0;
i++;
}
}
}
}
JVH3 said:
This app is not responsible for any sense restart loop.
My guess is that you are using Cookie 2.0 and have the Task widget on your homescreen, but no tasks to display. It's a common problem with Cookie 2.0.
Common fix found in that thread is to:
Stop Sense
add a task through the windows interface to tasks. With an energy ROM: Action->Task
Start Sense
--------------------------------------------
Literally, these app (Start Sense / Stop Sense ) change 1 registry entry when run.
Start Sense does this
[HKLM\Software\Microsoft\Today\Items\HTC Sense]
Enabled=1
Stop Sense does this
[HKLM\Software\Microsoft\Today\Items\HTC Sense]
Enabled=0
Click to expand...
Click to collapse
I do have Cookie 2.0, but no Task widgets. A simple soft reset brings Sense back to life. Strange. But thanks for the explanation on what the app does.
Re: What Start/Stop Sense Does
JVH3 said:
The app only stops sense and starts sense.
It does not stop Titanium (Windows Default) and it does not start Titanium...
Click to expand...
Click to collapse
Sorry, I thought the app was for Sense <---> Windows default, hence the icons I suggested in the other thread:
***
Thanks for your reply with details.
Joe Bleau said:
Sorry, I thought the app was for Sense <---> Windows default, hence the icons I suggested in the other thread:
***
Thanks for your reply with details.
Click to expand...
Click to collapse
That was one of the reasons that I went with the other 2 icons.
I have updated post #1 with a little more info, so that no one else will misunderstand.
Next Version Idea
Instead of my previous idea of 4 apps, just 3.
Sense
Titanium
Stop Today Items
I am thinking that number of users that are using Today items other than Sense or Titanium is too small to be concerned with. I don't use them, so I don't have any real motivation to support other today items.
So, unless a hefty donation comes my way requesting support of other today items besides Sense, Titanium, and None, I am not planning to support them.
This gives the ability to switch between them easily and also no today items for maximum available memory.
Sense would stop all today items and then Start Sense
Titanium would stop all today items and then Start Titanium
Stop Today Items would stop all today items.
I am open to names and suggestions.
Maybe Go Sense, Go Titanium, Today Items Off
Or Start Sense, Start Titanium, Stop Today Items
I am a programmer. Names would be deferred to sales marketing where I work, so please post ideas and pngs.
Thinking the current Start Sense icon works, but I would need a similar Titanium and maybe a cross between Titanium and Sense with the red circle.
Anyone with Art or photoshop talent, please post.
128x128 png is the prefered format.
Also, icons can not have muliple levels of transparancy. Either transparent or solid. No translucent.
Name Idea
SST
Stop (or Start) Sense Titanium, (also) Stop (or Start) Some Today's, (plus) Stop Start Today
Another name could be Today All, or Today Terminator. LoL
SST is a lil more universal for what it could stand for and describe as doing.
Basically what I want to know is what is the impetus for Android to redraw views.
If I change a resource like the image resource in an ImageView that has already been drawn the ImageView will be redrawn. But it seems I can't just change or add a view in something like GridView. Instead I have to use the adapter and I need to use invalidateView() for the view for the GridView be redrawn.
Why are ViewGroups like GridView designed in a way that make it use a different mechanism in the code to be redrawn? Why is the ImageView automatically redrawing, but they way the made GridView is that it has to have a method called to get redrawn?
Also just generally, what is ultimately causing the views to redrawn.
This isn't compatible with most KitKat ROMs!
Not sure how many of you are using the MMS/SMS app that comes with AOSP, CM and most other ROMs. It's good enough for my usage (don't text much), but I never liked those smileys. I do love the ones I use in Miranda though (from Kolobok).
So here is a solution to that problem, at least if you have root access. I developed a module for my Xposed framework. For those who haven't seen it yet, it can do many modifications to the system and apps in memory, without modifying any APKs. This makes it easy to try out and many modules can work for a broad range of ROMs.
I you want to try it, follow these steps:
1. Install the Xposed framework as described in this thread (REQUIRES ROOT!)
2. Install the attached APK and activate the module in the Xposed installer (this is also described in the framework thread)
3. Reboot
Then, download at least one smiley pack to your phone (see second post) and follow these steps to use it:
4. Import the smiley pack into the app
4a. Start the Smiley Replacer app
4b. Click "Choose a smiley pack"
4c. Click the "add" button (you might need to press the menu key if there is no such button)
4d. Use your favorite file browser to select the smiley pack
4e. Click "Start import"
5. Choose the smiley pack you just imported from the list
6. Restart the MMS/SMS app (there is a button for that which makes sure that the app is properly killed before)
This will only work for 4.0+ ROMs and only for the standard MMS/SMS app, assuming it's based on AOSP and the smiley renderer is not drastically modified. For example, I'm using CM10.1 (Android 4.2.1), but it also worked for Tungstwenty on a Samsung stock ROM with Android 4.0.3. Even though we both have a Galaxy S2, this module will also work on other devices. It only depends on a small subset of the MMS/SMS app code. So I hope this is the correct subforum (if not, feel free to move it).
Some things to note:
- This module doesn't include any smileys itself. You will need a smiley pack, which is easy to create (see second post)
- Smileys can be animated gif files. :victory: This makes it different from simply replacing the images. Please note that this requires many refreshes of the UI. On my phone, the CPU load is still ok, but maybe for some devices with less performance will have problems.
- Source code: https://github.com/rovo89/Smiley-Replacer
Changelog:
1.0: Initial version [116 downloads]
1.1: Fix cut-off smileys and MMS/SMS restart, add size selector [21 downloads]
1.2: Added an option to disable auto-resizing [10 downloads]
1.3: Fixed: Static smileys were still resized even when this was disabled
Example smiley packs / Format description
Smiley packs
AOSP: Default smileys from AOSP 4.2. That's not a big effect as your phone probably uses them already, but might be a good starting point for smiley packs. Especially if you have replaced the smiley graphics in the MMS.apk previously as you just need to replace the images.
Kolobok (attached): I use this one for myself. It contains the animated Kolobok smileys, which are simply lovely.
HTC Sense by noooooo
Emoji by noooooo
Facebook by Suprash
Facebook Messenger by Suprash/saywhatt
ICQ by noooooo
Yolks by saywhatt/bad-blood
IconTexto by saywhatt/IconTexto
Sony Xperia by m1l4droid
Hangouts by noooooo
tuzki animated transparent by justnoone
Skype smiley (Animated) by sasadara
Samsung ChatOn Emoticons by justnoone
Full Yahoo Emoticons Pack by MFaust
Galaxy Note Stock Emojis by justnoone
Cut the Rope by AlkaDragos
Facebook stickers by noooooo
BlackBerry Messenger by marsigliah
Huawei by MFaust
Kik Smileys by marsigliah
HeyWire Emoticons by marsigliah
LINE Stickers by marsigliah
Xperia Z1 by beatrat
Square by daniel_m
And a bit special, for those who don't want to have any smileys at all:
No smileys by m477m
File format
General
A smiley pack is a zip file consisting of a few text files for the metadata and of course the images, all directly in the zip (no subfolders).
I recommend to use "xyz.smileys.zip". Files ending with ".smileys.zip" can be opened and imported directly (unless your file browser insists on opending zip files itself).
In case you want to use characters like umlauts, you need to use UTF-8 character encoding without Byte Order Mark (BOM). I'm using Notepad++, where you can easily select this from the menu.
There is no limit of smileys, however keep in mind that quantity is not everything and that the smileys are local to the phone where the smiley pack is installed. Limit yourself to smileys you and your conversation partners actually send.
Images
I recommend to use png for static smileys and gif for animated smileys. In theory, other file formats like bmp should be supported, but it's untested and probably doesn't add any value. Transparency has to be included in the file itself, i.e. you should see it in the Windows image preview or whatever you are using.
The image size should be something between 20-30px, close to what they are normally display. The images are scaled automatically to match the text height.
info.txt
The first line of this file is the title of the smiley pack. All following lines are the summary.
codes.txt
This file contains a mapping between the images and the codes they replace. There is one line per smiley, empty lines and lines starting with a hash (#) are ignored. Each line has to start with the filename, then one or more blanks, then the main code (which is displayed in the "insert smiley" dialog), then optionally further codes, separated by one or more blanks. For example:
Code:
smile.gif :) :) =)
This would define a smiley with the (animated) image smile.gif, the main code "" as well as further codes "" and "=)". Any occurences of these codes will be replaced with the smiley image.
Only smileys defined in this file will be considered, any other images will be ignored. This file also defines the order of the smileys in various lists. The first smiley in this file will be used for the preview in the "choose smiley pack" screen.
descriptions.txt
Here, the texts displayed next to the smileys are defined. The format is similar to the one of codes.txt. The first field is again the filename, which is followed by one or more blanks. Everything after that is the smiley text. If no description is given for a smiley, the filename without extension will be used.
I recommend to re-use the texts of the builtin smileys if possible. You can do that with the dummy description "DEFAULT:XYZ", where XYZ stands for default smiley. Have a look at the AOSP smileys for a list of all supported smileys and the corresponding texts. As the texts will be taken from the installed MMS/SMS app, the text might vary slightly. But the good thing is: Translations are applied as well, so you profit from a wide range of supported languages.
Examples:
Code:
smile.gif I'm so happy
sad.gif DEFAULT:SAD
Translations
As mentioned in the previous section, the easiest way to get translations is using "DEFAULT:XYZ" whenever possible. However, you might want to add completely new smileys. If you just add the text to descriptions.txt, it will be used for all languages.
To add translations for selected smileys, you can create files like "descriptions-de.txt" (language) and "descriptions-pt-rBR" (language and region). This is the same naming convention as used for Android resources. In these files, you use the same format as in descriptions.txt, however you should only include those smileys which you want to translate. Other texts are inherited from more general files, which means that everything not translated in e.g. descriptions-pt-rBR.txt will be taken from descriptions-pt.txt. If it doesn't exist there either, it's taken from descriptions.txt. The last fallback is the filename without extension as mentioned before. So you don't need to repeat the text from those general files, especially not the "DEFAULT:XYZ" texts.
That's it, I think that should cover it all. For examples, look at existing smiley packs. If you have created a new smiley pack, ping me and I will add a link in this post.
Re: [MOD][XPOSED][4.0+] Smiley Replacer
Working perfectly on stock based 4.1.2 Samsung ROM, on my Note 2. Amazing work, thanks
sent from somewhere
Re: [MOD][XPOSED][4.0+] Smiley Replacer
Great job man
Re: [MOD][XPOSED][4.0+] Smiley Replacer
what about iPhone emoji which is basically what the droidified ones represent ?
Sent from my HTC Sensation using xda app-developers app
Emoji are left untouched by this mod. I haven't looked into them for a couple of reasons:
- Both sender and receiver need a phone that supports emoji
- For you to see an icon, the sender needs to actually insert an emoji, so you don't have the control yourself
- I have never sent or received an emoji
- I think emoji are a bit more standardized than smileys, so I'm not sure if they should be changed too much
I just added the file format descriptions to the second post for anyone who would like to create their own smiley pack.
Confirmed working on 4.2! Great work man! I had been looking for something similar for ages! 2proposal if i can say them:
1 maybe add a facebook and sense 4.5 static pack
2 maybe make them quite bigger
however, fantastic work!
I love the Kolobok smileys, so I'm not gonna use any others. But opinions differ, that's why I chose not to hardcode my preferred smileys but created a file format that is open and it doesn't require any programming skills. Create whatever you like and please share the results.
About smiley sizes: I thought it would be good that they are just as high as the text around them, so that the line height and the space between the lines is unchanged. I have just tried and applied a hardcoded scaling factor - it works, but to me it doesn't look nice because the line spacing is uneven.
rovo89 said:
I love the Kolobok smileys, so I'm not gonna use any others. But opinions differ, that's why I chose not to hardcode my preferred smileys but created a file format that is open and it doesn't require any programming skills. Create whatever you like and please share the results.
About smiley sizes: I thought it would be good that they are just as high as the text around them, so that the line height and the space between the lines is unchanged. I have just tried and applied a hardcoded scaling factor - it works, but to me it doesn't look nice because the line spacing is uneven.
Click to expand...
Click to collapse
I've tried to make an xperia mod pack but it recognises only the smileys i haven't changed, can you help me?
You are using many png files, but all of the smileys in codes.txt are .gif. You have changed descriptions.txt, but most important is codes.txt: "Only smileys defined in this file will be considered, any other images will be ignored."
So, here's the one X pack and, if possible tell me what to modify if i want them quite bigger!, thanks!
In the class MovieSpan, add one line:
Code:
public int getSize(Paint paint, CharSequence text, int start, int end, Paint.FontMetricsInt fm) {
if (fm == null)
fm = new FontMetricsInt();
paint.getFontMetricsInt(fm);
[B][COLOR="DarkGreen"]fm.ascent = fm.top = (int)(fm.ascent * 1.2);[/COLOR][/B]
if (mVerticalAlignment == ALIGN_BASELINE)
fm.descent = fm.bottom = 0;
mScale = (float)(fm.descent - fm.ascent) / mMovieHeight;
return (int)(mMovieWidth * mScale + 0.5f);
}
Same in AutoHeightImageSpan (well, actually you need to copy the whole method as I forget to make it similar to the one in MovieSpan):
Code:
public int getSize(Paint paint, CharSequence text, int start, int end, FontMetricsInt fm) {
if (fm == null)
fm = new FontMetricsInt();
paint.getFontMetricsInt(fm);
[B][COLOR="DarkGreen"]fm.ascent = fm.top = (int)(fm.ascent * 1.2);[/COLOR][/B]
if (mVerticalAlignment == ALIGN_BASELINE)
fm.descent = fm.bottom = 0;
int height = fm.descent - fm.ascent;
float scale = (float)height / mDrawableHeight;
int width = (int)(mDrawableWidth * scale + 0.5f);
mDrawable.setBounds(0, 0, width, height);
return width;
}
Note that this will not scale the smiley by exactly 120%, but something close to it. This is because the top of the drawing area is moved up, whereas the bottom stays the same. With this, at least only the space before the line increases, not the space after the line. That said, I can only repeat that I don't think it looks nice with uneven spacing, but if there is a high demand for this, I might make this an option.
Thanks but i thinks it's too complicate for me i'll keep the small one
Well, as I said: Maybe that will be an option one day. However, maybe you can say anyway what you think about the downside of the larger smileys: the uneven spacing. This makes it a no-go for me, but maybe other think it's fine.
yeah i noticed too that some smileys are cut
What do you mean with "cut"? I had a short look at our smileys and they were fine. If you mean the conversation list, then it's normal that the text (including smileys) is cut off at the right-hand side.
One more question: You describe your smileys as "Sense" smileys. So that means they are the default ones from HTC Sense?
R: [MOD][XPOSED][4.0+] Smiley Replacer
And yes,the default ones
Inviato dal mio HTC Sensation con Tapatalk 2
great job man!!
great job
noooooo said:
And yes,the default ones
Click to expand...
Click to collapse
Ah yes, this is what I had fixed for the animated smileys, but forgot for the normal ones. Happens when there are only smileys in one line, no text. I have a fix for this (I think), but not enough time today to release it.
The code below is from a backup of Total Launcher (my personal favorite).
Apparently there will be one instance of similar code for each widget defined on each launcher page.
As you can see, this example is for Zooper widget. But each Zooper widget use can have a different "skin".
SO, how is this "skin" specified in the below code? It seems that the parameter "i":715 would have something to do with it, but I don't know what the parameter means. Some sort of index maybe?
Other parameters are easily deduced like T , L, W and H for top, left, width and height.
This seems to be a somewhat normal android paradigm; I've seen references to lots of other widgets (not Zooper) and most utilize the "i" parameter.
I have added two ZW's to a page in TL and set each to a different "skin". The lines below will be added twice to the parameter file with ONLY the "I" parameter different.
Anyone??
Boowho??
{"w":360,"aw":360,"b":[{"T":3,"p":"org.zooper.zwpro\/org.zooper.zwlib.provider.WidgetProvider4x4","i":707,"X":-2.5,"Y":-41,"W":360,"H":360},{"T":3,"p":"com.xwidgetsoft.xwidget\/.appwidget.XWidgetMain4x4","i":715,"X":-2,"Y":195,"W":360,"H":418.5}]}