Hi there,
I'm a little bit stuck with a page transition.
In my app, I select a name from a listbox which is located in another page (Page 2)
Once the name is selected from the listbox (in page 2) it automatically returns to the calling page.
Problem is that during the transition, in the OnNavigatedTo event of Page 1, it fires a query which takes some time and the transition is freezed during that time.
How can I add a ProgressBar to warn the user?
If possible, I'd like to stay as "official" as possible, so my idea is to use the standard ProgressBar supllied in the RTW.
I tried many searches and found nothing close to a workable sample on this.
Any help is much apprecitated in advance!
GFR_2009 said:
Hi there,
I'm a little bit stuck with a page transition.
In my app, I select a name from a listbox which is located in another page (Page 2)
Once the name is selected from the listbox (in page 2) it automatically returns to the calling page.
Problem is that during the transition, in the OnNavigatedTo event of Page 1, it fires a query which takes some time and the transition is freezed during that time.
How can I add a ProgressBar to warn the user?
If possible, I'd like to stay as "official" as possible, so my idea is to use the standard ProgressBar supllied in the RTW.
I tried many searches and found nothing close to a workable sample on this.
Any help is much apprecitated in advance!
Click to expand...
Click to collapse
If you're not already using the PerformanceProgressBar, you should be.
http://www.jeff.wilcox.name/2010/08/performanceprogressbar/
It's pretty much 'plug&play'.
There are 2 ideas which you could try to fix your problem.
An idea that you could try is using a DispatcherTimer. A timer will allow the function to finish loading, while creating an event which will fire to display the progress bar. When the page has finished loading, (say 1 sec) your timer could tick, and do whatever work you need done. Another solution would be to add a Loaded event on the page. This would allow you to run some code once the page is fully loaded. This is probably the best design. To do that, you'd need some code like this:
Code:
public MainPage()
{
InitializeComponent();
Loaded += new RoutedEventHandler(MainPage_Loaded);
}
void MainPage_Loaded(object sender, RoutedEventArgs e)
{
ProgressBar pb = new ProgressBar();
pb.Style = PhoneApplicationService.Current.State["PerformanceProgressBar"] as Style;
pb.IsIndeterminate = true;
//add it onto the page, since it wasn't done in XAML.
LayoutRoot.Children.Add(pb);
}
Note that you can still create the ProgressBar in XAML, it was just easier to only show 1 file.
williammel,
Thanks a lot for the answer. Very clear and helpful!
Will try it right now.
Cheers,
Gus
Related
This was from the windows mobile team blog. More to follow but wanted to post it for those who don't read that.
Original link: http://blogs.msdn.com/windowsmobile/archive/2008/06/03/customizing-the-sliding-panel-homescreen.aspx
Customizing the Sliding Panel Homescreen
from Windows Mobile Team Blog by Jorge Peraza
Hi, my name is Jorge Peraza; I am a Developer on the Windows Mobile team that was responsible for the new “Sliding Panel” home screen in Windows Mobile 6.1.
When we were working on the visual style and functionality of the home screen we tried to make something that looked both professional and appealing while still showcasing all the information the user is going to need to know what’s important and requires attention. While I think the default design looks really cool, we added some customization features to enable users to make it their own.
Customizing the layout
The home screen layout can be modified using the same home.xml file from previous versions of WM, the schema of the file was extended to allow the customization of many of its elements, this includes the art assets that are used for most of the plug-ins.
When you open the SlidingPanel.home.xml file (inside \ApplicationData\Home) you will find the plug-in element that corresponds to the sliding panel home screen (its CLSID is {E9267CAB-02EE-4f37-8216-6BF6A8FF5A71}). All the child elements inside it are designed to tweak and customize the way the home screen will look.
The top level element is the plugins tag, this has one attribute called “Order” and it’s used to list the plug-ins that will be shown and the order they are going to be laid out on the screen.
The built in plug-in names are:
1)CClock – The big clock
2)CAppointments - The calendar plugin
3)CHome – The notifications plugin
4)CMyPhotos – The photos plugin
5)CMessage – The message center (this is off by default on all sliding panel built in layouts.
6)CMusic – The music plugin
7)Settings – The settings plug-in
8)Custom Plugin – Users can specify custom plug-ins with static content that can be displayed on the home screen.
For example, the XML snippet bellow moves the photos plug-in to the first position and enables the message center (which is turned off by default on both "Sliding Panel" and "Sliding Panel Media")
<plugin clsid="{E9267CAB-02EE-4f37-8216-6BF6A8FF5A71}" name="Bronze" height="266">
<Plugins Order="CMyPhotos;CClock;CMessage" />
</plugin>
There are many other ways of customizing the home screen using the plug-in settings like overriding the default images or even adding your own custom plug-ins that display static content, I'll post and updated entry latter on on how to do this in detail but for now, you can use the provided home.xml files to start experimenting with this.
The notifications plug-in and message center
In the sliding panel home screen, the notifications plug-in by default serves as a dual-purpose notifications/gateway to all you phone/message accounts where every page represents one account (so, if you have multiple notifications in one category they will be shown as one summary page).
There is however an alternative behavior where individual notifications are added as independent pages (Similar to what the T-Mobile shadow home screen does) and the plug-in only shows accounts that have new notifications in them. One cool feature of this alternate behavior is that each individual notification can be dismissed without having to leave the home screen.
You can enable this alternative behavior by setting the following registry key to a value other than 2 (The actual value indicates how many pages of each notification type will be added to the home screen before collapsing them into a summary page. We have tested 2 and 5 but feel free to experiment with other values)
[HKLM\Software\Microsoft\Chome\Chome]
PageCollapseThreshold: DWORD
Note that this prevents you from being able to access the email/phone account data if there are no notifications for it. If you still want to be able to do that you can always re-enable the message center as described in the previous section as a separate plug-in.
There is one more behavioral change you can make that allows you to “dock” the condensed view of the first plug-in to the top of the screen when it is not active, we added this for people like me that want to have the clock always visible. To enable just set the following registry key to “1”
[HKLM\Software\Microsoft\Chome]
DockOperatorBar: DWORD
Advanced layout modification
There are even more advanced things you can do to further tweak the look of the home screen but it is unsupported by Microsoft at this moment so you’ll have to experiment on your own J (Hint, look at the following files \windows\CHome_240x320.cpr and \windows\CHome_320x240.cpr).
----------------------------------------------------------------------------------------------------
Thanks to djNutz for posting this information & OrganicM for his efforts.
I wanted to create a post with info about what the different keys do in the CHome section of the registry. So, I'll start with a brand new one, that I bet nobody knows about....
[HKLM\Software\Microsoft\Chome\Chome]
PageCollapseThreshold: 2 or 5 (DWORD Value)
This will collapse your Notifications panel to only show active notifications. You can enable this alternative behavior by setting the following registry key to a value other than 2 (The actual value indicates how many pages of each notification type will be added to the home screen before collapsing them into a summary page. 2 and 5 were tested and work pretty well.
More to come of course....
should this change be made to the security section too, or does that matter? actually, do changes to the security section ever matter, cause they seem to apply even when you only edit the software section.
p.s.
i'm pretty sure people are gonna ask, so maybe i'll save some trouble instead of looking like an ass by answering preemptively. This DWORD value must be created with your registry editor, it's not already there, at least on ricky v24.
2 = default or normal (i assume cause it looks the same as before) and 5 = condensed.
But for the rest of us who don't have the time to be on every WM blog and forum at once here's my favorite:
To “dock” the condensed view of the first plug-in to the top of the screen when it is not active, set the following registry key to “1”
[HKLM\Software\Microsoft\Chome]
DockOperatorBar: DWORD
This is so you can have the clock always visible, no matter which panel you're on. You could also set it so that CHome Weather's compact view is always on top. Whatever plugin is first on the list.
More info from MS coming down the pipe:
We can get the day of the week on the clock plugin at the top of CHome by doing this:
Replace this portion...
<!-- Date --> <Text ID="Date" Left="180" Top="83" Width="110" Height="19" FontFamily="Segoe Condensed" FontSize="9" FontStyle="Bold" Wrap="False" HorizontalAlignment="Left" Trimming="EllipsisCharacter"></Text>
With this!
<!-- Date -->
<Text ID="Date" Left="180" Top="83" Width="110" Height="19" FontFamily="Segoe Condensed" FontSize="9" FontStyle="Bold" Wrap="False" HorizontalAlignment="Left" Trimming="EllipsisCharacter"></Text>
<Text ID="Day of Week" Left="65" Top="83" Width="110" Height="19" FontFamily="Segoe Condensed" FontSize="9" FontStyle="Bold" Wrap="False" HorizontalAlignment="Right" Trimming="EllipsisCharacter"></Text>
I will incorporate this in Chome Weather fore sure!
Here you go, the first is my Home
2nd is Scroll Down once
3rd is Scroll Down twice
4th is Scroll Down Thrice
heh
Edit: Tried Month in cpr, no luck.
will keep trying
I'm glad people are finally getting this information out. It makes customization that much easier. I'm adding the tips to the wiki as well, as they come out.
How to Reload the Homescreen
I have two questions:
1. After editing my CHome cpr file, how do I reload the homescreen without having to reboot the device?
2. How can I show any text on the clock panel? Regular text is defined by Text ID = "xxxxx", where xxxxx is something like Time, Network Name, etc. However, suppose I want to have the text "Knowledge Rules", how do I set it up in XML?
I have very little programming and Excalibur experience. So, I apologize if these questions are too naive or have been answered before.
Thanks a lot in advance.
you can use this if you dont use OrganicM Chome Weather
I don't think Microsoft has put out much documentation on the sliding panels plugin yet. Most of the CHome configurations use
Code:
TextID="text 1"
as the delimiter for static text. But that's not to say that the clock plugin will recognize that as a valid section. Could work. Could make your phone useless.
beartard said:
I don't think Microsoft has put out much documentation on the sliding panels plugin yet. Most of the CHome configurations use
Code:
TextID="text 1"
as the delimiter for static text. But that's not to say that the clock plugin will recognize that as a valid section. Could work. Could make your phone useless.
Click to expand...
Click to collapse
I do not understand. How do I make the phone know that:
text 1 = Knowledge Rules?
Typical syntax seems to be Text ID = "xxxx", where xxxx is a variable name, which is recognized by the device. If Text 1 is a valid variable for the device, how do I assign it a value? Am I rambling here?
No, you're not rambling. As far as the information coming from Microsoft and disseminated here on this site goes, it's a best guess right now.
someone at msdn blog asked the same question.
Someone at msdn blog asked the same question. Let's wait to see if we get an answer from there...
From http://blogs.msdn.com/windowsmobile...ustomizing-the-sliding-panel-homescreen.aspx:
"Jorgeba, thanks for taking the time to educate your user. I have some questions.
How do you change the text in the condense clock? The .cpr file has Text ID="Text 1". How is "Text 1" define? I would love to add the date to the condense layout.
The ActionURL and Softkey2 URL in the Appointments plug-in always open calendar in the today view. Is there a way to make one of the button opens calendar in the month view? Setting the default view for calendar does not help."
Easy as pie......
If you know what you are doing.
If you have any xml experience,then you'll know how to adjust x and y values to position things in different places. Yes, you can do that. Just change x=whatever and y=whatever to where you would like them to be. Just know this means that it will start on the left and move x pixels over and y pixels down. If you put in negative values, it will shift them in the opposite direction.
Eg. x=-whatever will move it to the left vs a + value which will move it to the right. Same for y=
Also, you can adjust the valignment and halignment to center, left, or right.
Have fun with these. They apply to everything in your cpr (That's the layout for your homescreen.It's in your \Windows directory on your phone).I mean everything, from where your network displays, right down to your pictures.
That's it. Have fun!
jaymit said:
Hi,
Sorry Im kind of a newbie :s, is it possible to edit home screen panels? I wanted to change the layout and look of the clock plugin.
Thanks!
Click to expand...
Click to collapse
Does anybody know how to change font color for certain panels or certain lines of text in the panel? Is it only possible for the whole homescreen?
As far as I know even as far as old xml coding works, you can only change a font color for a selected word or unselected word. Meaning, if you have the old 6.0 your plugins that are selected could have a different color, but unselected could be another color. This applied to the entire homescreen. I have not seen different colors for different plugins, since each panel style is basically its own plugin (each has its own unique GUID), then I doubt you can change font color for each plugin. You can more than likely only change the active selected panel and inactive panel fonts. I am not sure what their titles are in the cpr, but I know that in the old 6.0, the homecolor was one of the fonts colors and the other was called something else.
Eventhough this is 6.1, it doesn't look like much has changed as far as the fonts color goes. You could, however, always try adding a "fontcolor=" command in the cpr and a hex code and try it, to see if it works.
Hope this helps.
Edit your registry or get CHome Config
Both do the same thing. You want to change the plugin order for CHome. It's located in HKLM\Security\CHome\Default Settings and in HKLM\SOFTWARE\Microsoft\CHome. Edit the order you want your plugins to go. Reboot your phone and the new edits should be reflected in your homescreen layout. If you are having trouble cause this is new. Just search this thread for CHome Configurator. It's stickied at the top of this forum. Download it and it will let you select the order in a much easier way. Make sure you reboot, though, or else your changes won't show. Hope this fixes your problem. Later.
tae-xda said:
How to change the default location for where the CMyPhotos plugin
Click to expand...
Click to collapse
rollingondubs1 said:
I have that already, All my games are under a folder which i cant make it as a action url
Click to expand...
Click to collapse
try this
"ACTIONURL" = "\Windows\Start Menu\Games\xxxxx xxxx.lnk
or this
"ACTIONURL" = "\windows\fexplore.exe; \windows\start menu\games"
Yes you can
One last time, I think I've figured out how to help you.
1. Open Chome Config.
2. Scroll to MyApplication and select it with your center button.
3. Scroll to any page you want to edit. Then scroll down to where it says ActionURL. Press menu.
4. Once in the menu select the "1 Change URL" item.
5. Once you have selected that it will take you to a file explorer. Go to \Windows\Start Menu\Games. This is where your games should be. If not, then wherever you store, your games, navigate yourself to that folder and select the file you want.
I think this should cover it. Hope this solved your problem. HOLLA!!!!
rollingondubs1 said:
I have that already, All my games are under a folder which i cant make it as a action url
Click to expand...
Click to collapse
How to change the location of CMyPhoto to \Storage Card\My Documents\My Picturs
intro: I'm a bachelor student who has a little knowledge of programming.
For the first time i try to make a simple game that i already wrote in java work in vb.
I'm planning to make this a full working game that I can place on the market place for free.
I already have the idea how to make the AI to play 1 vs PPC
I wrote it for a WVGA screen but its completely dynamic so it should work on other screen sizes.
Only when you change the orientation the text will not be visible (need to think where i'm gonna place it)
pls feel free to give input on the project.
I uploaded the whole vb net directory so its open for everybody
(Im still a bit strugling with a cab file that has links in it
if you instal it, it should be visible in the programfiles dir)
--edited 24/08
-thanks to Gaz25 the refresh problem is soved
-the 4 on a row detection algorithm is completed
Hi, I had a look at your code and fixed your flicker problem.
Basically, when you do you own drawing on a control like a panel you need to take control of painting the background as when a control is redrawn it paints the background first and then anything else on top like text, images etc...
The best thing to do is create a custom control. Then you can override the OnBackgroundPaint event and say do nothing.
Then override the OnPaint event and here is another trick.
In the OnPaint event, create a bitmap. This will be the 'backbuffer' which you will do all your drawing on. Then when you have done all your drawing on the backbuffer, you draw the backbuffer to the screen.
I have included your solution with my modification which I hope make more sense .
If you need more explanation then let me know and I will go into more detail.
Gaz25 said:
Hi, I had a look at your code and fixed your flicker problem.
Basically, when you do you own drawing on a control like a panel you need to take control of painting the background as when a control is redrawn it paints the background first and then anything else on top like text, images etc...
The best thing to do is create a custom control. Then you can override the OnBackgroundPaint event and say do nothing.
Then override the OnPaint event and here is another trick.
In the OnPaint event, create a bitmap. This will be the 'backbuffer' which you will do all your drawing on. Then when you have done all your drawing on the backbuffer, you draw the backbuffer to the screen.
I have included your solution with my modification which I hope make more sense .
If you need more explanation then let me know and I will go into more detail.
Click to expand...
Click to collapse
i will look at it monday when i'm back from a festival
thanks in advance.
sended from x1
Thank you very mutch,
i just tested it and it works perfect.
I will try to make it better in the following weeks.
Only one thing that you changed in my code that wasn't correct "speler = 0" (on load, needs to be 1 or 2) (speler = player)
I also found an error in my own algortim for the 4 on a row detection
"teller1 = teller2 = 0" ( gave me a -1 on teller1)
I’m very new to programming, but I wanted to see if I can write a simple application that uses a dictionary API to query a server somewhere (if I said that right). I have some ideas for a few more difficult apps so I wanted to start with this simple one.
I’m mostly using Expression Blend to create these apps.
The first thing I would like to know is:
* How do I use a wp7 icon (from the icon pack) as a clickable button? I have an input search TextBox, but instead of using a simple button control (for the click event) I would like to use the magnifying glass icon as the search button --something similar to how Bing (on WP7) uses the mic in the search box. How can I accomplish this?
The second thing I would like to know is:
* How is an API use in app? I found a few APIs/ RSS feeds and XML data sources that I would like to utilize in my future apps, but I’m not sure how to implement them.
EXAMPLE: hxtp://api.somewebsite.xxx/xsomething=item1&sip=somethingelseI’ve read some about URI. What is this?
So basically, I would like to create an app that goes out to a server somewhere and fetch information based on a user’s keyword input and click event.
Please help!!!
- Learning developer
Welcome to silverlight programming
First up, here's a xaml snippet for showing an image in a button:
Code:
<Button Padding="4"
Margin="4">
<Image Source="Images/Search.png"/>
</Button>
I removed some of the attributes on the button and the image for clarity. Basically, a button can be used to show any UI element in this way.
Regarding your second question:
I haven't got a lot of experience outside of using WCF services, but for reading a feed I basically use a WebClient to download the xml file and then parse the file with linq:
Code:
WebClient client = new WebClient();
client.OpenReadAsync(new Uri([I]address[/I], UriKind.Absolute));
client.OpenReadCompleted += (sender, e) =>
{
if (e.Error != null)
{
/* Error Processing */
}
else if (e.Cancelled)
{
/* Operation was cancelled */
}
else
{
XElement feed = XElement.Load(e.Result);
foreach (XElement item in feed.Descendants("item"))
{
/* Process here */
}
}
};
I'm open to suggestions for a better way to do this though...
I don't know about everyone else but I would love to see apps that support our Nook's hardware buttons for scrolling and turning pages. I created an small app just to find out exactly what these buttons were. I have attached the test apk and the source for it.
The buttons generate a KeyEvent that can be captured in the normal manner for handling key presses.
Left top button - 92
Left bottom button - 93
Right top button - 94
Right bottom button - 95
All the developer has to do is test for those in addition to whatever they are already monitoring for. I am going to begin emailing developers with this information and see if I get any "takers". I have emailed the following and will post a status here if I hear back:
Kindle - 5/16: Received an email saying the suggestion would be forwarded on to the appropriate development group
NewsRob (via google group) - 5/16: The developer is going to add page up/down and article up/down support!
FeedR - 5/16: Email sent
Aldiko - 5/16: Email sent
FBReader - 5/16: Email sent
In addition I am going to add hardware button support to some open source apps. I have located a number of open source RSS apps:
http://code.google.com/p/feedgoal/
http://code.google.com/p/feeddroid/
http://code.google.com/p/reader/
As an example of what we can do I have attached an updated FeedGoal where I have added support for the hardware buttons to scroll up and down on a feed article.
Update 5/17/2011:
I have modified the Browser from the stock Eclair to support page buttons and compiled it. When I try to start it on the Nook it comes up and then shuts down. One of the times I saw a "signing in" box. My thoughts is that it is trying to do something that requires gapps on the phone? If anyone has any ideas I'd be glad to try them.
* Reserved
Keys are actually
key 407 RIGHT_NEXTPAGE
key 412 LEFT_NEXTPAGE
key 139 LEFT_PREVPAGE
key 158 RIGHT_PREVPAGE
xboxexpert said:
Keys are actually
key 407 RIGHT_NEXTPAGE
key 412 LEFT_NEXTPAGE
key 139 LEFT_PREVPAGE
key 158 RIGHT_PREVPAGE
Click to expand...
Click to collapse
Those numbers are the scancodes from the keymap file TWL4030_Keypad.kl. If you are wanting to watch for key inputs in an Android application you override the "onKeyDown(int keyCode, KeyEvent event)" method and the "int keycode" that get's printed out is 92-95.
The format of the keymap file (TWL4030_Keypad.kl) is "key SCANCODE KEYCODE [FLAGS...]". In your example 407 is the SCANCODE and "RIGHT_NEXTPAGE" is the KEYCODE. The numerical value of "RIGHT_NEXTPAGE" is either 94 or 95 depending on how you set your Nook up.
If someone wants give the two attached apk's and test and verify (I've already ran them myself) that they do work as intended that would be great.
- The TouchTest should print out 92-95 (keycode) on the screen when you press them.
- The FeedGoal should page up and down when you press the right or left side keys. I may go back and change the left side to be page up/down and the right side to be article back/forward.
ReadItLater
I add a ticket to ReaditLater Support Forum.
http://support.readitlaterlist.com/...droid-support-for-nook-touch-hardware-buttons
update:
i contact the dev of electrodroid, too
are there new answers from the devs?
If you remaps two keys to VOLUME_UP and VOLUME_DOWN, almost all reading-centric programs work will hardware buttons. I have tested:
Read It Later
Kindle
Aldiko
FBreader
CoolReader
Moon+Reader
RSSdaemon
NewsRob
BuzzBox RSS reader
They all works with remapped buttons.
aruangra said:
If you remaps two keys to VOLUME_UP and VOLUME_DOWN, almost all reading-centric programs work will hardware buttons.
Click to expand...
Click to collapse
yes, of course.
but this is just a workaround and i already recognized that there are situations where i have to take the nook in the other hand to turn a page...
for example: i use the left keys remapped to volume for readitlater, so i can only use the right keys on the default reader app (which i prefer).
i think for some apps you will always have to do this remapping, especially for the kindle app in my thougts.
and it seems to me that the devs will easily can integrate this buttons in their apps.
a lot of other apps are already working with the default mapping:
e-mail
twicca
titanium backup
root explorer
alogcat
autostarts
moon+
...
Is there no way to remap the hardware buttons using like a driver software (sorry, completely noob regarding android software). Remapped buttons would help on repligo and ezpdf, my preferred readers.
I liked seeing the NewsRob support in the change log. But it only scrolls half a page down so you have to hit it twice.
I found that my old technique of remapping the key to SPACE worked better; SPACE is a page-down shortcut for most WebView apps. Unfortunately my SHIFT SPACE mapping in the layout file seemed to ignore the shift part. :-(
Android 3.0 adds real page up/down keys finally, so more apps should support the keycodes then. This isn't just a Nook issue; I've been trying to fix this on my Galaxy Tab too.
I blame Apple for not including a page down function because it's so "cool" to flick the screen around. Hope you have good timing.
Good news, everyone!
This weekend I received reply from FBReader authors. Here is the translation:
Since version 1.1.3 FBReader is able to read external file with actions mapped to keys. One can put keymap.xml file into main directory, which is /sdcard/Books by default.
File format can be seen in example:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<keymap>
<binding key="4" action="cancelMenu"/>
<binding key="23" action="processHyperlink"/>
<binding key="24" action="volumeKeyScrollBackward"/>
<binding key="25" action="volumeKeyScrollForward"/>
<binding key="66" action="processHyperlink"/>
</keymap>
All possible actions are here:
Code:
String SHOW_LIBRARY = "library";
String SHOW_PREFERENCES = "preferences";
String SHOW_BOOK_INFO = "bookInfo";
String SHOW_TOC = "toc";
String SHOW_BOOKMARKS = "bookmarks";
String SHOW_NETWORK_LIBRARY = "networkLibrary";
String SWITCH_TO_NIGHT_PROFILE = "night";
String SWITCH_TO_DAY_PROFILE = "day";
String SEARCH = "search";
String FIND_PREVIOUS = "findPrevious";
String FIND_NEXT = "findNext";
String CLEAR_FIND_RESULTS = "clearFindResults";
String SET_TEXT_VIEW_MODE_VISIT_HYPERLINKS = "hyperlinksOnlyMode";
String SET_TEXT_VIEW_MODE_VISIT_ALL_WORDS = "dictionaryMode";
String TURN_PAGE_BACK = "previousPage";
String TURN_PAGE_FORWARD = "nextPage";
String VOLUME_KEY_SCROLL_FORWARD = "volumeKeyScrollForward";
String VOLUME_KEY_SCROLL_BACK = "volumeKeyScrollBackward";
String SHOW_MENU = "menu";
String SHOW_NAVIGATION = "navigate";
String GO_BACK = "goBack";
String EXIT = "exit";
String SHOW_CANCEL_MENU = "cancelMenu";
String ROTATE = "rotate";
String INCREASE_FONT = "increaseFont";
String DECREASE_FONT = "decreaseFont";
String PROCESS_HYPERLINK = "processHyperlink";
String SELECTION_SHOW_PANEL = "selectionShowPanel";
String SELECTION_HIDE_PANEL = "selectionHidePanel";
String SELECTION_CLEAR = "selectionClear";
String SELECTION_COPY_TO_CLIPBOARD = "selectionCopyToClipboard";
String SELECTION_SHARE = "selectionShare";
String SELECTION_TRANSLATE = "selectionTranslate";
String SELECTION_BOOKMARK = "selectionBookmark";
Program must be restarted in order to pick up changes in config file.
Can anyone test if this really works? I can't test it right now.
And, I suggest to make a donation to this wonderful program authors.
Cheers.
Great news!
If other developers would do the same, we'd be in heaven.
I'll only be able to try it tomorrow, but I'll inform as soon as I do it.
DenisTheMenace said:
Good news, everyone!
This weekend I received reply from FBReader authors. Here is the translation:
Since version 1.1.3 FBReader is able to read external file with actions mapped to keys. One can put keymap.xml file into main directory, which is /sdcard/Books by default.
Program must be restarted in order to pick up changes in config file.
Can anyone test if this really works? I can't test it right now.
Click to expand...
Click to collapse
Thanks! It works very nicely with FBReader. My keymap.xml file:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<keymap>
<binding key="92" action="nextPage"/>
<binding key="93" action="previousPage"/>
<binding key="94" action="nextPage"/>
<binding key="95" action="previousPage"/>
</keymap>
Does anyone know the key number of the Nook button? It's quite useless for FBReader and it would be nice to remap it to some other function. Thanks!
Anyone thought of trying to create a service that'd catch the button presses outside of the stock apps that'd then send the right command for whatever. For example if you press the page forward button or page backward button in stock apps it'd function as designed. If you push it somewhere else like within your custom launcher or another app it'd perform as menu/home/back whatever
GabrialDestruir said:
Anyone thought of trying to create a service that'd catch the button presses outside of the stock apps that'd then send the right command for whatever. For example if you press the page forward button or page backward button in stock apps it'd function as designed. If you push it somewhere else like within your custom launcher or another app it'd perform as menu/home/back whatever
Click to expand...
Click to collapse
Yes for remapping the n-button. See this post. But still haven't had the time to do it. Too busy with work.
GabrialDestruir said:
Anyone thought of trying to create a service that'd catch the button presses outside of the stock apps that'd then send the right command for whatever. For example if you press the page forward button or page backward button in stock apps it'd function as designed. If you push it somewhere else like within your custom launcher or another app it'd perform as menu/home/back whatever
Click to expand...
Click to collapse
I've started working on exactly this during this weekend. I have so far succeeded in creating service that runs in the background and makes the upper left button a "HOME" button - meaning it shows the home activity of your choice rather than the built in menu like the n button. I'll be glad to give more technical details on what I have learned so far (when I have time, probably next weekend).
In the mean time, I would like input from other users as to some specifics on how it should work.
Here is my current vision:
- Have option to start the service manually or automatically start at boot (currently hard coded to start a boot)
- The keylayout files can remain untouched so that they still work properly for the stock applications
- the service will be aware of what Activity is in the foreground and remap purpose the buttons accordingly.
- there will be a settings Activity that lets you choose the functionality of each button on a per application basis
- the choices will to be to broadcast an Intent or to create a virtual key press (for example, my "HOME" button does not actually cause a HOME key press, but broadcasts a act...MAIN cat...HOME intent, my next experiment will be to send Vol Up/Down keys when Kindle app is running)
And this is slightly off topic, but I would like put this on sourceforge or google so that others can contribute and have easy access to it. I've never done that before, so advice on this would be appreciated.
mycr0ft said:
but I would like put this on sourceforge or google so that others can contribute and have easy access to it. I've never done that before, so advice on this would be appreciated.
Click to expand...
Click to collapse
May I suggest github? git is much more sophisticated than CVS/SVN and their clones.
I basically agree with the app functionality. May be I will take part in implementation (I wish there will be ~36-48 hours in a day )
Thanks for the advice. github looks promising.
Anyone interested can have a look:
Code:
https://github.com/mycr0ft/nook-touch-button-service
I've run into a bit of a problem with simulating a key press. The android developers have not made it easy (which is good for device security).
- I have tried Instrumentation.sendKey..., but that only works withing the same application. Even with the INJECT_EVENT permission, you cannot inject events into other applications (unless they are signed by the same packager). Repackaging every single app that you load does not sound like a good option.
- I have tried using the 'sendevent' shell command. This appears to be limited to only duplicating scan codes keys that actually exist.
- I am currently trying to compile uinput driver (available in the source code download from bn) and load it using insmod. I am stuck here for the time being because I can't figure out how to get it to compile to the right kernel version (version magic mismatch in dmesg)
I think you will need root to inject a key event in an other app
You can look at the SoftKeys source code (here), it may help you.
In the past, SoftKeys used a script called "input" to inject events (according to http://forum.xda-developers.com/showpost.php?p=10497165&postcount=309) but now it seems that it uses something else ...
mdall, thanks very much. this is very useful information.
Droid Comic Viewer
I think also Droid Comic Viewer would benefit from hardware buttons support.
It's a nice little comic reader app supporting all relevant formats (CBR, CBZ, ACV & image formats). Animations can be disabled and there's no dependency with touchscreen interface (it can be entirely operated with button actions). This would make it perfect for an e-ink screen.
I sent an email to the devs today, let's hope they get back to us!
Is there a way to hide certain input panels on the window form using configuration or config file of some sort?
For example.... let's say in my database I have items with 12 possible fields in each (Name, LastName, Age, Occupation, Location.......etc).
But what is a user of application only wants to fill in 3 fields every single time (for example - LastName, Age, Location)? Leaving others in place when user doesn't needs them is an extra clutter. So how can I hide or disable those input panels based on user's preference on which fields he wants to use?
--
I think I found a way to hide items by setting Visible boolean.
Code:
this.txtName.Visible = false;
this.lblName.Visible = false;
this.txtOccupation.Visible = false;
this.lblOccupation.Visible = false;
However, how can I move up other fields between or below them? Currently hiding just creates empty spaces.
You can turn the textbox off completely by setting its enabled property to false.
You can then move other textboxes and labels over it by setting their Location.X and Location.Y properties.
You will have to keep track of where everything is on the screen, and what is enabled and what isn't.
stephj said:
You can turn the textbox off completely by setting its enabled property to false.
You can then move other textboxes and labels over it by setting their Location.X and Location.Y properties.
You will have to keep track of where everything is on the screen, and what is enabled and what isn't.
Click to expand...
Click to collapse
Thanks.
Do you know if there is an easy way to move everything up? (lets say I make first item invisible and want to move the 10 items below up) Or will I have to call everyone individually to move up?
Also.. Is there away how I can use TabIndex to call those forms?
There are others ways to accomplish what you are looking for, but no easy route to it.
They all end up as broad as long. You either spend time during the design stage, creating an array of possible tabbed forms to be used by the program later, or spend time designing the program to deal dynamically with the fields required. The latter of the two is harder to do, but it is far more elegant.
Sorry, but there is no silver bullet.