Newb Programming Question - Windows Phone 7 Software Development

Firstly, I apologize for so a terribly novice question; I have looked and googled but part of my problem is I believe I am asking the question wrong.
So, I am just trying to build a VERY simple wp7 program. Main page would have several buttons, which pressing would take you to a page with information on the topic of the button you just pushed, and with another button back to the home screen. Again, very simple. For example, it could be an app of The Rolling Stones, and each button would be a link to a band member's small bio. Nothing too fancy, just dipping my toes.
My problem is I cannot find the action I need to attribute to a button. I can build the home screen and add buttons and text easy enough, and make the other "pages" or screens, but I do not know how to make the button navigate to those pages. And every search I do results in explanations of how to add web links, which is not what I want to do.
Sorry for the newb question, but I appreciate all responses and advice.

There are several ways to do the job:
1. - Define "Click" event for Button (double click on button in designer or on events properties);
- Add "using System.Windows.Navigation;" at the top of your main page .cs file;
- Add "NavigationService.Navigate(new Uri("/NewPage.xaml", UriKind.Relative));" to the "Click" event handler
2. - Open you page in Expression Blend;
- In the "Assets" (left top corner) window select "Behaviors";
- drag "NavigateToPageAction" to your button;
- fill "TargetPage" property (at the right top corner)
3. You may also manually edit your page.xaml source (see the source changes after using method 2)

Put any Button on the Page, simply Double Click that button, this will generate by Default a Click Action Event Handler, in this write the following
NavigationService.Navigate(new Uri("PageName.xaml", UriKind.Relative));
also, you should NOT add buttons to go back, developers are encouraged to have users using the hardware key for going back as you are simply adding more and more to the Navigation Stack which is responsible for keeping track of the users Navigation through Apps, kind of like your Web Browser, you navigate to google,. then 10 pages later, and if you navigate back by URL rather than the built in "GoBack" function for the browser, you end up clicking the back button a hundred times going forward to the page you stopped looking for information then to every page in between which you navigated through to get to that information, it just uses more Memory and for a users experience you should not use buttons that go back let the user control the flow
Good luck on your app mate

Related

(Happy) Easter Eggs in WM6

WM6 Easter Eggs - WM6 Features (search terms)
This is a list of new and little known features in WM6.
Please add any I miss to this thread and I will try to put them in this post (with credit of course)
1. Typing on the keyboard on the today screen will automatically bring up the phone with matching contacts. Certain phone skins do not support this and you will just get a text box with scroll bars covering half the screen but nothing in it. If this happens switch your phone app with the Tweak app (varies depending on who’s WM6 you are running)
2. From Messaging (Outlook, SMS, MMS, [POP/IMAP? not tested] ) if you start typing it will search through your messages for whatever you type. Hold “H” for a list of shortcuts. I think the shortcut keys mean hold that letter.
3. Under calendar; If you create a new appointment and decide you don’t want it, you can now pres menu and cancel (cancel was not in wm5)
4. When typing in WiFi keys (WPA, WEP, whatever) you can actually see what you are typing instead of just ******.
5. The new feature I found that I love is if you go into the options for the calendar you can now set it to start in Month view (or whatever view you prefer). I couldn't stand the fact that WM5 kept reverting back to agenda!
(Thanks chymmylt!)
6. The camera finally keeps adjustments like contrast and sharpness saved.
Previously if you soft reset or power off and on the phone, these settings would always revert back to the defaults.
(Thanks abubasim!)
7. In Contacts, when you edit a contact you now have 'File As' useful if you want Forename Surname instead of the default Surname, Forename
(Thanks nbedford! [I installed the "File As" plugin and never noticed that it the ability to change it was built in =)] )
8. In Outlook, if you [Reply All] by default it copies your own email address into the recipient list, so you receive your own mails, even if you auto-save them already in Sent Folder. I found that extremely annoying because with every [Reply All] I had to manually remove my email address before sending.
You can avoid this easily:
1. Programs -> ActiveSync
2. Menu -> Options
3. Select the E-mail information type and tap Settings
4. Tap Advanced
5. Enter the e-mail address you want to remove when replying to all senders in My e-mail addresses
(Thanks aublumberg, This applys to WM5 also but not to many people know this one.)
Let me know if this is a waste of space, and if not, lets keep this thread on topic and point out all the fun reasons to use WM6.
Later, Lew
thanks. couple those i didnt know about.
not quite "easter eggs" though are they
thanks for sharing this information
i found the firts two points very usefull, and (correct me if i'am wrong) due to the lack of a propper wm6 manual i think this thread comes quite handy
The new feature I found that I love is if you go into the options for the calendar you can now set it to start in Month view (or whatever view you prefer). I couldn't stand the fact that WM5 kept reverting back to agenda!
The camera finally keeps adjustments like contrast and sharpness saved.
Previously if you soft reset or power off and on the phone, these settings would always revert back to the defaults.
In Contacts, when you edit a contact you now have 'File As' useful if you want Forename Surname instead of the default Surname, Forename
Bump for added Features.
Not new, but little known and well hidden:
- press and hold the action button
- tap and hold the clock in the title bar until the dots stop moving
- when you release both the stylus and the action button, you get a small menu with an "execute" (or "run") entry. Tap that to get sort of a command line prompt.
Cheers
Daniel
Very nice thread. thnx for the little hints
Are there any real easter eggs in win mobile?
Pisquee said:
Are there any real easter eggs in win mobile?
Click to expand...
Click to collapse
I hope that is a joke. i wouldnt be surprised if it's not
tadzio said:
Not new, but little known and well hidden:
- press and hold the action button
- tap and hold the clock in the title bar until the dots stop moving
- when you release both the stylus and the action button, you get a small menu with an "execute" (or "run") entry. Tap that to get sort of a command line prompt.
Click to expand...
Click to collapse
This is a real easter egg!
WIKI Pls
In the interest of WIKI and promoting the use of knowledge being written once and used many times, there is already a knowledgebase for this with lots of stuff, if you can add yours and close this, everybody will know where to go for their easter eggs...
http://wiki.xda-developers.com/index.php?pagename=Hermes_Buttons
Tap and hold the clock on the title bar lets you switch between digital and analog disply - no idea that happened until now!
I guess, you already know this...
Pressing the "power button" for 3 seconds turns off (not just standby) the device (with WM2003 it wasn't possible...)
This is probably an old one but I didn't know it myself until Googling for it:
In Solitaire, open the on-screen keyboard, tap Ctl and Shift and then Deal. It gives you the perfect hand.
Source: The Easter Egg Archive. The site has a few more . . . of which this one is the only one that seems to be working.
VivaErBetis said:
This is a real easter egg!
Click to expand...
Click to collapse
. . . but an old one. I could do this one on my old JAMin (WM5 AKU2.0).
pello said:
I guess, you already know this...
Pressing the "power button" for 3 seconds turns off (not just standby) the device (with WM2003 it wasn't possible...)
Click to expand...
Click to collapse
it's in the manual
panzer said:
it's in the manual
Click to expand...
Click to collapse
Yes i know but...i have never touched a manual for mobile devices
BTW: i don't need this function
Good and handy tips!!! Thank you.

IE built-in dictionary option

I was reading a scientific article on my phone today and thought that it would be cool if IE offered some built in dictionary. Since copy and paste was implemented when you press a word it is automatically highlighted and the little icon pops up that enables you to paste. I was thinking it would be awesome if, in addition to the copy icon, there was another icon that looked like a magnifying class and when you pressed it a mini popup came out of the word with the definition from dicitonary.com or something.
Is this possible?
Would anyone else welcome such a feature?
Highlight the word and press the Search button on your phone.
Just tested this but it requires many more clicks/presses.
Your method:
Press word
Press search button
Press search result
My method:
Press word
Press define button
There would also be significantly less waiting on the data connection if my method was implemented, even more so if it was an offline method.
I would welcome the feature, but there is no such or plans as far as I know. It was good back in the days that Encarta was available and we could use the accelerator in IE to find the meaning of words.
The option given by RG is good enough.
True RG's suggestion is better than nothing, my problem is that it's inefficient and I want my phone to be as efficient as possible.
Ahh encarta

[N2E] Nook Touch - App Support for Hardware Buttons

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!

Return to forum (thread) listing?

Am I missing some way to easily navigate back to the forum page when I'm at the bottom of a thread of postings?
vBulletin (that's not what we're using here, right?) has a dropdown at the bottom of every page where you can select a forum to navigate to, and by default it always has the current forum being read already selected, so you can just hit GO.
Here in XDA I get to the bottom of a page and can't figure out how to get back to the topic listing, except by going back to the top of the page, and clicking on the forum name in the forum->subforum->threadTitle navigation.
This is very cumbersome.
Pressing the BACK button on the keyboard is certainly an option, but this suffers from not updating the topic listing page, so I can't easily see which threads have new posts since I last visited them.
Sorry for the small novel explaining this.
If you use Chrome then you could use the XDA Toolbar (see my sig), made by one of the handsome and witty intelligent devs of this very site
It currently has a "Jump to top of page" button on it, which will halve your problem, but there will be a release soon that will include the ability to double-click that very same button and go to the parent forum (exactly like what you're asking for). The advantage of this is that you have to be neither at the top or bottom of the page to use it.
If you don't use Chrome, get used to pressing the home key a lot
Thanks for the response! Yes, I found the 'top' line quite a while ago, but never thought of using the home key. That helps a lot.
I look forward to the upgrade!

ReadingBuddy - app to help you in reading pdf books.

This is my first app for any platform.
This simple app will help you to read any pdf book page by page. It remembers the page when you leave the app, and opens the same page whenever you re-open the app. It also includes a bookmark for lines, which will help you in remember the line to continue reading from, whenever you open the app.
Tutorial:-
- swipe down or press down arrow key (in pc), to open a menu with options like opening a new book, changing app background, setting page rendering quality.
- swipe up or press up arrow key (in pc), to open a menu with information and options for the current page.
- swipe right and left or press right or left arrow key to go to next or previous page.
- click on the right edge of the screen to set bookmark for line.
This app is tested on windows 10 desktop and windows 10 mobile.

Categories

Resources