Related
Hi,
I've recently been handed a project that requires forms based data capture (on a xda mini-s). I dont want to limit users to having to use either landscape or portrait mode when completing the forms.
Is there a way to detect the screen orientation and/or get an event when it changes?
thanks
Andy
what language ?
win32?
.net?
yes good point
.net CF v2
C#
Sorted now - it actually generates a form.resize event
i was just over complicating the task
Folks,
I have created a small photo viewing application that I wanted to publish to the world. Key features are
- Native C code. No dependencies on .NET or any other library
- Tiny (just 25Kb)
- Full screen photos with gestures and hot-spots
- Slide-show mode
- Nice transitions (you can see them all in the slide show mode)
I have tested this on my GPS (CE 4.2) and PDA (Hermes) and it works quite well.
Gestures:
- Slide left to go to next photo in list (You can also use the wheel down for this)
- Slide right to go to previous photo list (You can also use the wheel up for this)
- Slide up to go to last photo in list
- Slide down to go to first photo in list
Hot Spots
- Top left to open a specific folder. Folder navigation is done by sliding up and down and select the <This Folder> to select
- Bottom left to open a specific photo. Again, you can slide up or down or go to a specific folder
- Bottom Right to start/stop slide show mode. Slideshow is 3 seconds. You can change the config file to specify different interval
- Top right to exit
- Right edge of screen to go to next photo in list
- Left edge of screen to go to previous photo list (You can also use the wheel up for this)
- Bottom edge of screen to go to last photo in list
- Top edge of screen to go to first photo in list
Configuration
CEPhotoViewer saves its configuration in CEPhotoViewer.cfg in the same folder as the exe. This file contains the last open folder and the slide show timeout
Startup
- On startup CEPhotoViewer looks for any JPG/BMP/GIF images in the program's folder. Else it prompts you to select a folder. Once selected the config file is created and subsequent runs, it will automatically pickup that folder
Bugs
- CEPhotoViewer uses native microsoft DLL to load a image. Depending on the speed of your CPU, this loading might be slow. Photos resized to the correct size (under 640x480) load pretty quickly. Large (2MP+) photos take a couple of seconds to load. Perhaps someday I will include native JPG loading codeDone
- CEPhotoViewer is built for ARM CPUs only. I can build for other CPUs but dont have a device handy
Looking forward to your comments. Im also working on finishing a MP3 player and a launcher (more appropriate for GPS devices)
Version history
- v0.67 (3/25/2008)
First public release- v0.68 (3/26/2008)
Integrated JPEG processing. Much faster in loading big images (although the size tripled from 20Kb to 60Kb)Added edge hot-spots to navigate in addition to slide gestures
Feature Request
What do you think of adding in touch Pan, Tilt, Zoom, & Rotate? Also, it would be cool if it auto rotated based on the original pictures orientation.
Thanks,
Curious G
i'll give this a shot when i get home
curious george said:
What do you think of adding in touch Pan, Tilt, Zoom, & Rotate? Also, it would be cool if it auto rotated based on the original pictures orientation.
Thanks,
Curious G
Click to expand...
Click to collapse
Forgot to mention, pictures are auto-rotated if they can fit better in the screen. Also auto-rotates if you change the display (like when I pull out the keyboard)
Nice but it wouldn't load my actual (2mp) photos. Sliding is a bit slow but very smooth. Wouldn't quit and at some point all corners stopped working.
Trekvogel said:
Nice but it wouldn't load my actual (2mp) photos. Sliding is a bit slow but very smooth. Wouldn't quit and at some point all corners stopped working.
Click to expand...
Click to collapse
Loading large images is time consuming, sorry, thats the way microsoft has implemented JPG processing. The corners are not 'not responding', the program is still trying to load the image.
Im trying to compile ijl jpg library that can loaded scaled images, that way I only decompress the size I want
3/26 - Version updated
Guess I'm in the minority who resizes images to fit in PDA screen. Due to popular demand, I have integrated the IJG jpeg library to considerably speed up loading of large images (largely due to internal image scaling)
Also added edge hotspots to navigate images, rather than slides which are bit cumbersome
my personal opinion(i havent seen program YET):
any viewer, that cannot show gif/animgif/png/tga/bmp files is pointless.
it doesn't matter how "touch"-ed it will be.
so - i am gonna update opinion after tests..
nothin said:
my personal opinion(i havent seen program YET):
any viewer, that cannot show gif/animgif/png/tga/bmp files is pointless.
it doesn't matter how "touch"-ed it will be.
so - i am gonna update opinion after tests..
Click to expand...
Click to collapse
It does show gif and bmp. Adding png is trivial (libpng can be compiled easily in CE, both PNG and TIF take about 100Kb each). My intent is to what cover 80% of the people would want.
Just tried it on my Trinity and, while the transition speed is nothing to write home about, the software works. Not sure if i prefer this or S2V, but it has to be said this is a nice application.
Edit
Could do with more space at the top when navigating folders, the directory path disappers under the "This Folder" button.
Please could we have screenshots?
iamwhoiam said:
Please could we have screenshots?
Click to expand...
Click to collapse
It shows your photo on the full screen, so screenshots are not of any use
deedee said:
Just tried it on my Trinity and, while the transition speed is nothing to write home about, the software works. Not sure if i prefer this or S2V, but it has to be said this is a nice application.
Edit
Could do with more space at the top when navigating folders, the directory path disappers under the "This Folder" button.
Click to expand...
Click to collapse
The main goal of writing this app was to have it working on all CE devices (including GPS that do not have the .NET framework installed).
Also, there are more transitions than just the slides that are visible when you are in slide-show mode
Amazing Program!!
I've just gotten myself a windows mobile phone. I looked everywhere for a simple photo viewer that could scroll through images by tapping on the left or right of the screen. I didnt understand why resco photoviewer or pqv or any of those other photo viewers didnt have this feature. It was so frustrating.
Also I wanted to browse folders starting at a pre-configured Picture folder. I didnt want the program to go scanning my whole PDA for pics including gifs and pngs for some other softwares.
Finally found this program and I'm really happy.
I wonder if you're still developing this program though? This thread doesnt seem to be active anymore. I hope you'll still continue developing this program.
If you're too busy, I'd be happy to help in some aspects of coding or improving the program. It really is that amazing to me.
Hope this program is still alive.
Lodd said:
I've just gotten myself a windows mobile phone. I looked everywhere for a simple photo viewer that could scroll through images by tapping on the left or right of the screen. I didnt understand why resco photoviewer or pqv or any of those other photo viewers didnt have this feature. It was so frustrating.
Also I wanted to browse folders starting at a pre-configured Picture folder. I didnt want the program to go scanning my whole PDA for pics including gifs and pngs for some other softwares.
Finally found this program and I'm really happy.
I wonder if you're still developing this program though? This thread doesnt seem to be active anymore. I hope you'll still continue developing this program.
If you're too busy, I'd be happy to help in some aspects of coding or improving the program. It really is that amazing to me.
Hope this program is still alive.
Click to expand...
Click to collapse
Glad to hear that this application is working well for you.
I have not stopped development on this, added additional features like PNG, GIF decoding and automatic rotation.
This being a PPC forum, there is not much need for this app since there are multiple options (including built-in applications). I had made this app and many others primarily for GPS and other low end devices without the standard libraries.
I will update this thread with the latest version and also add other applications I have built (including native MP3/OGG player, simple shell, GPS dashboard etc), all totally skinnable and configurable
The program has been amazing. Loads huge pictures with no problem. It's definitely faster than Vito's EyePhoto.
But Coolsva, I have a question. Now call me crazy, but I want to be able to set it up so that when I click a jpg file in file explorer or total commander, it will open up in your photoviewer instead of the windows mobile default viewer (coz it sucks). What're the parameters to do so? I tried the normal parameter "%1" but it doesn't seem to work.
I'm glad you're still working on this program.
Cool program , but zoom would be nice feature
coolsva said:
I will update this thread with the latest version and also add other applications I have built (including native MP3/OGG player, simple shell, GPS dashboard etc), all totally skinnable and configurable
Click to expand...
Click to collapse
Looks interesting, please do it !
Just now landed at this thread after spending a while checking out google results for "windows mobile picture viewer". Coolsva's prog sounds very worth trying, but I'm wondering if 0.68 is still the latest release?
HarpShot
________________________________
He had a photographic memory that was never developed.
Just saw this too, this could have real potential
I'm also searching for a simple photo viewer like Lodd mentioned
There are a lot of clock area today screen apps out there, from the simple such as PDClock, through mid-level stuff like HTC home, up to the fully customizable rlToday.
Few of these seem to be a good all-round solution though, except maybe rlToday, but I am having issues with the rlToday / Sys-to-Reg / Mortscript combo, both in terms of features (ie no support for "on" or "off" images), stability, and ease-of install (S2R seems a bugger to set up right, especially for the less technically inclined user), and the whole rlToday / S2R / Mortscript combo is hardly a turnkey one-install solution.
So to that end, I decided to try my hand at crafting a solution more appropriate to my needs.
Now, until this point I have never coded for C++ or windows mobile. I am not even a professional coder, far from it, but I do have a knack for designing good solutions, so I thought I would start teaching myself native C++ and see what I could come up with. Ultimately, my goal is to release as open source, I am hoping to maybe start a sourceforge project at some point...
I am making this post because I am now starting to get past the proof-of-concept stage and am coming up with some working code. I am tackling the various hurdles one by one and learning as I go, but it is starting to look promising.
This thread is to serve two purposes:
1) Gather my thoughts on how things are going to work so potential users can chime in on possible tweaks or changes to the features and how they should work.
2) Serve as a rallying call for any (preferably more experienced) coders who wish to get involved. I will post up any problems that I am having surmounting various issues, please feel free to help out on those. If an experienced coder liked the project that much and wanted to take the lead, I have no issues with that, as long as it remained open source.
So, with that out the way, here is what I am thinking so far:
Overall idea is pretty similar to rlToday - a script (ie a .INI or .XML file) which lists Widgets is processed and the result is drawn on the screen.
For example, here is an example INI file for a background (say transparent) PNG with a clock overlaid in the middle of the PNG, that has different layouts / images for portrait and landscape mode on a qVGA device.
Code:
;ini profile for qVGA (240 width and 320 width)
;PORTRAIT
[PortBG]
width=240
widget=image
clickable=0;
image="bgport.png"
x=0
y=0
[PortClock]
width=240
widget=text
subwidget=clock
clickable=1
clicktype=exe
clickstring="<exe to launch calendar>"
dateformat = "dddd MMMM d"
x=120
y=25
origin="cc"
;LANDSCAPE
[LandBG]
width=320
widget=image
clickable=0
image="bgland.png"
x=0
y=0
[LandClock]
width=320
widget=text
subwidget=clock
clickable=1
clicktype=exe
clickstring="<exe to launch calendar>"
dateformat = "dddd MMMM d"
x=160
y=25
origin="cc"
The [Name] of each section actually does nothing, but it will be useful in debugging / error messages ("Image for [PortBG] not found!").
Widget = choses which kind of widget it is (eg Image, Text)
subwidget = choses the subtype of widget (eg clock is a subtype of text)
The Width= entry is an idea I came up with to handle multiple screen orientations and resolutions within one profile. Basically, as this is not intended to be a full-screen app, the only relevant dimension is the screen width. Each widget therefore has an associated width. When the screen is rendered, it will check what the current width is and only render widgets that match that width. Furthermore, if a script has entries for resolutions not supported by your device, these will be ignored. Profiles are likely to be a directory with one .INI file and assorted images. Images can be in subdirectories, say grouped by width (ie a "240" dir and a "320" dir for qVGA) - that way you could release a skin as one zipped dir that supported all devices and resolutions, and you would not need to upload the "480" and "640" dirs to a qVGA device, thus saving storage space.
Each widget also has x/y coords, which usually refer to the top left, but the origin entry can change that (eg cc would be centre horizontally and vertically)
Each widget will also be able to be specified as clickable, with options as to what to do when it is clicked.
With this system it should be possible to create most things, however, here is what I am currently NOT planning on doing:
I am not aiming at offering tabbed pages of widgets, or an easy way to change widgets without writing a new script. This is aimed at a companion to something like UltimateLaunch for handling the top of the screen - a Clock, SMS / Missed Calls / VM messages, BT / WiFi status and toggles etc.
I am currently using VS2005 and the WM5 SDK, but the app is still so simple that this could probably be changed. I would like to support as much as possible, but am not overly worried about providing backwards compatibility beyond WM5. I am using Native Win32 - I want to avoid as much bloat as I can.
Planned features:
Per-pixel Alpha PNGs - IMPLIMENTED
Widgets parsed from INI - IMPLIMENTED
Parse only items from INI that match screen caps - IMPLIMENTED
Display only items that match current screen width - IMPLIMENTED (Effectively switch profile on screen orientation change)
Options screen to set current profile
Widgets
======
Text Type: - IMPLIMENTED
Source: String in INI - IMPLIMENTED
Source: String in Registry
Source: Date from format string - IMPLIMENTED
Image type: - IMPLIMENTED
Plain image - IMPLIMENTED
Status Image - Registry value
Toggles - BlueTooth / WiFi / Phone etc
Other features
===========
Multiple screen resolutions supported per INI - IMPLIMENTED
Detect Power but no Activesync - Allow enabling of BlueTooth for automatic pairing with in-car BT handsfree.
Current questions and stumbling blocks:
Having issues finding a lightweight way of displaying per-pixel alpha PNGs. Current thinking is that AlphaBlend is perfectly capable of doing the blending, it is just SHLoadImageFile that is stripping the alpha info.
See threads here and here
Not sure how I am going to handle toggling of BT / WiFi. Could use VJ's tool, but I would rather do it in my code. Any pointers on how to do it and maintain maximum WM5 / WM6 compatibility would be appreciated - VJ's tool will not toggle WiFi on my Kaiser anyway...
Could do with decent chop and chomp routines (split by char and remove leading / trailing whitespace) - does anyone know an easy way to do this in native code?
Need to work out how to find the size of a text string in pixels *before* it gets drawn to the screen with ExtTextOut
Need to impliment a date format string to text string converter that can handle date and time objects in the same string
Currently I use a bit of code to look at the string and pass it to either GetDateFormat or GetTimeFormat, but not split the string and pass relevant bits to relevant routine, then reassemble.
Need to make whole thing a today item, but delaying doing this as it seems that debugging will be harder? I also guess this would be quite easy, so I am planning on leaving this until near the end. Any advice on this subject would be appreciated.
I am interested in this. I don't know C++, but I have experience coding with other computer languages. I'll definitely be following this thread and watching for updates.
iContact source contains some pretty lightweight INI library. It isn't written by me, and it's called SimpleIni. Everything is contained in one .h file and it's very easy to use.
good luck,
larna
larna said:
iContact source contains some pretty lightweight INI library. It isn't written by me, and it's called SimpleIni. Everything is contained in one .h file and it's very easy to use.
good luck,
larna
Click to expand...
Click to collapse
Nice one, thanks
I got simpleini in and working - you were right larna, it was really easy and pain-free. Thanks!
Update:
I have a working prototype.
All basic functionality coded - text and image widget types, orientation switching, ini parsing...
Currently still not a today item, and there is loads to do in terms of error checking and freeing up memory etc, but it parses INI files OK
Once I have done some tidying up, I will release some source and maybe a demo EXE.
Hey!!
I'm already developing an application which load and extends rlToday Themes!
sources will be released soon!
The app is XIAMultitheme:
Done:
- fully working rltoday themes on a HWND
- done today plugin
- loading external dll
- all widgets are external dll
To do:
- avoid image loading via ImageFactory due to memory leak on wm6x
- port to CxImage to load PNG
- use AAROT to free rotate images (analog clock)
- today plugin does not load the engine yet
http://www.xiaprojects.com/?section=All&project=XIAMultiTheme
what do you think? mail me on priv (stefano) on xiaprojects.com
stefanux said:
Hey!!
I'm already developing an application which load and extends rlToday Themes!
sources will be released soon!
The app is XIAMultitheme:
Done:
- fully working rltoday themes on a HWND
- done today plugin
- loading external dll
- all widgets are external dll
To do:
- avoid image loading via ImageFactory due to memory leak on wm6x
- port to CxImage to load PNG
- use AAROT to free rotate images (analog clock)
- today plugin does not load the engine yet
http://www.xiaprojects.com/?section=All&project=XIAMultiTheme
what do you think? mail me on priv (stefano) on xiaprojects.com
Click to expand...
Click to collapse
hi stefano
i see nothing on your web site , nor screenshots nothing in download binaries
Why ???
evilc said:
Update:
I have a working prototype.
All basic functionality coded - text and image widget types, orientation switching, ini parsing...
Currently still not a today item, and there is loads to do in terms of error checking and freeing up memory etc, but it parses INI files OK
Once I have done some tidying up, I will release some source and maybe a demo EXE.
Click to expand...
Click to collapse
can you upload here the demo program ?
Sounds pretty neat!
I don't understand some of the terminology you use, but I think you may be talking about a feature I had an idea for:
profiles (XML files) can be associated with a today plugin such that you can make a profile appear in the today plugins list for each skin (XML file) you have installed - thus making each XML profile behave like it was a today plugin in it's own right.
Is that what you are talking about?
brunoisa10 said:
can you upload here the demo program ?
Click to expand...
Click to collapse
Demo uploaded to first post. Unzip it to \Storage Card\shared on your device and run.
BE AWARE, there is very little error checking when parsing the INI.
If you omit a horizres line for any widget, for example, the program will crash.
Well I checked out XIAMultiTheme and it looks promising.
I was not aware that there was a memory leak bug in IImagefactory, I wasn't planning on using it in the final version anyway, so no biggie.
If XIAMultiTheme is capable of doing what I had envisaged for openClock, I will probably stop development, as you obviously know what you are doing much more than I do
However, a couple of points:
1) Size.
XIAMultiTheme seems to be a lot bigger and requires .NET - This seems to mainly be to do with the CxImage library - just PNG support seems to add more size than my entire app is! I am flabberghasted that supporting per-pixel Alpha PNGs takes this much, an alphablend routine can be done in a K or two, hundreds seems overkill. Apart from the requirement for rotation (for analogue clocks) I do not see why a full image lib is needed. Just a load and alpha blit.
2) Orientation awareness.
As in I don't see any in XIAMultiTheme. I am really happy with the way I have handled this in openClock - each item in the INI (XML in your case) has a "horizres" value associated with it. At render time, current screen width is compared to each item's horizres and if it matches, the item is drawn, if it doesn't then it isn't shown.
This provides a nice way to combine portrait, landscape and multi-res capabilities into one theme. And as long as you allow relative paths in the theme(eg 320\320bg.png, 240\240bg.png, common\common.png) then you can have a theme which supports all resolutions and orientations, and allow the user to store what they want on their PPC (eg if their device is qVGA, they know they do not need to put the 640 and 480 dirs on their PPC for a given theme, as they won't be used)
3) Stateful buttons.
Items like a voicemail button / wifi button etc should probably have two images associated with them - one for "no messages", one for "have messages". I was planning on putting something in openClock along the lines of specifying a reg key, an operator and an image.
eg:
regkey=HKEY_LOCAL_MACHINE\...
on=thisimage.png, gt, 0
off=thatimage.png
To set to thisimage if the key is of value greater than (gt) 0 or thatimage.png if not.
Good luck!
evilc said:
just PNG support seems to add more size than my entire app is!
Click to expand...
Click to collapse
Yep. Same goes for MortButtons... (and MortPlayer, but there, the player itself is bigger in relation...)
I am flabberghasted that supporting per-pixel Alpha PNGs takes this much, an alphablend routine can be done in a K or two, hundreds seems overkill.
Click to expand...
Click to collapse
The alphablend routine is in the Draw method, and even in source code not much more than 1kB.
The trouble is to load the PNG without losing the alpha information. With Windows' API, you can't do it - there's only the crippled SHLoadImage. So you need the entire code to decode PNGs, i.e. libpng, which in return requires zlib - over 200kB only to load PNG! The remaining kBs are spend to load/decode JPEG (quite some kBs, too), GIF (if enabled), BMP, ... and some basic image processing (resample, rotate, ...).
btw, you might want to check MortImg.dll and MortImage.lib, which is a (quite) simple wrapper. If only one image library is used, at least some memory on the device is saved (and if MortButtons or MortPlayer since b72 is used, also main memory).
Check out http://mort.svnrepository.com/svn/mort/MortTools/trunk with any SVN client (e.g. Tortoise), use "guest" for login and password.
evilc said:
Well I checked out XIAMultiTheme and it looks promising.
I was not aware that there was a memory leak bug in IImagefactory, I wasn't planning on using it in the final version anyway, so no biggie.
If XIAMultiTheme is capable of doing what I had envisaged for openClock, I will probably stop development, as you obviously know what you are doing much more than I do
However, a couple of points:
1) Size.
XIAMultiTheme seems to be a lot bigger and requires .NET - This seems to mainly be to do with the CxImage library - just PNG support seems to add more size than my entire app is! I am flabberghasted that supporting per-pixel Alpha PNGs takes this much, an alphablend routine can be done in a K or two, hundreds seems overkill. Apart from the requirement for rotation (for analogue clocks) I do not see why a full image lib is needed. Just a load and alpha blit.
2) Orientation awareness.
As in I don't see any in XIAMultiTheme. I am really happy with the way I have handled this in openClock - each item in the INI (XML in your case) has a "horizres" value associated with it. At render time, current screen width is compared to each item's horizres and if it matches, the item is drawn, if it doesn't then it isn't shown.
This provides a nice way to combine portrait, landscape and multi-res capabilities into one theme. And as long as you allow relative paths in the theme(eg 320\320bg.png, 240\240bg.png, common\common.png) then you can have a theme which supports all resolutions and orientations, and allow the user to store what they want on their PPC (eg if their device is qVGA, they know they do not need to put the 640 and 480 dirs on their PPC for a given theme, as they won't be used)
3) Stateful buttons.
Items like a voicemail button / wifi button etc should probably have two images associated with them - one for "no messages", one for "have messages". I was planning on putting something in openClock along the lines of specifying a reg key, an operator and an image.
eg:
regkey=HKEY_LOCAL_MACHINE\...
on=thisimage.png, gt, 0
off=thatimage.png
To set to thisimage if the key is of value greater than (gt) 0 or thatimage.png if not.
Good luck!
Click to expand...
Click to collapse
thanks you for your good words
1) beta version will be lighter ... (need to known what image loader use)
2) will be done on Page component (tab themes are already working)
3) will be done on sensor dll with "regex" (maybe)
XIAMultiTheme is in alpha development...
I would like to "merge" code with you or may be DLL collaboration.
XIAMultiTheme does NOT need .NET it's low level GDI "C" source
When XIAMultiTheme go on Beta status the dll will be around 10kb
Configurator is .net
Thanks you
Thanks for that mort!
However, if my entire app is (currently) 61K and it supports per-pixel alpha PNGs (Via the apparently bugged IImagefactory), then surely it is more than possible in less than 100K.
It seems like libpng must be grotesquely bloated for our needs. In an ideal world, someone would re-code SHLoadImage to not lose the alpha channel for PNGs. Maybe a workaround would be to convert the PNG into a 32bit per-pixel BMP with alpha before it is passed to SHLoadImage, as SHLoadImage deals with alpha BMPs just fine and AlphaBlend works just fine with AC_SRC_ALPHA data.
stefanux said:
thanks you for your good words
1) beta version will be lighter ... (need to known what image loader use)
2) will be done on Page component (tab themes are already working)
3) will be done on sensor dll with "regex" (maybe)
XIAMultiTheme is in alpha development...
I would like to "merge" code with you or may be DLL collaboration.
XIAMultiTheme does NOT need .NET it's low level GDI "C" source
When XIAMultiTheme go on Beta status the dll will be around 10kb
Configurator is .net
Thanks you
Click to expand...
Click to collapse
Hi stef,
I am more than happy to help out on your project with design ideas, testing and proofreading of english translations.
I have plenty of ideas on what the ultimate today screen widget app should feature, I just had to set my sights lower due to my (lack of) coding abilities.
Do you have a forum or something on your site? I don't see one.
I am slightly concerned about point (3) and your regex example. I would maybe try and keep it simpler, XML is already a little complicated for non-technical users to understand, throwing regexs into the mix may be the straw that broke the camel's back. That's why I went with INI files - simpler to use for lusers
evilc said:
Thanks for that mort!
... it supports per-pixel alpha PNGs (Via the apparently bugged IImagefactory), ....
Click to expand...
Click to collapse
Please try to do this test:
load 20 png's with imgfact. and start drawing all of them like a simple animation for 10 fps... image[]->Draw() after 5 minutes my application will blow up my pda (wm61) I thinks it's a "COM" bug because it happend only calling "Draw"
stefanux said:
Please try to do this test:
load 20 png's with imgfact. and start drawing all of them like a simple animation for 10 fps...
Click to expand...
Click to collapse
Are you kidding??? 10FPS? I have a kaiser!
Seriously though, if we can get a code snippet that proves this, surely we can get MS to issue a patch?
I wrote this little program, called SensorMaze. It generates mazes and allows you to steer a little blue dot using the movement sensors in the HTC Diamond. It is based on the original SensorTest program and since it has been a while since I programmed for any PDA, it is a bit simple.
Usage:
Try to send the blue dot to the red dot by tilting your Diamond in the required directions.
Commands:
- New Maze: create a new maze in the same level
- Next Level: increase the complexity.
As mentioned, it is my first attempt, so there is still some work that needs to be done.
TODO:
- Implement timer, so you can compete against yourself
- remove the "Position" text and replace with timer output
- MessageBox instead of Dialog ?
- Replace the blue dot with a "ball" like structure
- Release the source code (after cleaning it a bit more)
Question:
When I try to use MessageBox from my code, the MessageBox fails to close and I can never get back to the Shell without a reset. Any one any idea what I could be doing wrong here ?
Changes ( 07-Aug-2008)
- Replaced the target with a cheese and the moving dot with a mouse icon.
- Added some text to show the current level.
- Initial level is lowered, so that kids could play it too.
Screenshots are provided in the attached .png files. I also added the sources, so that other people can see how you can use the acceleration meter
If you like my applications, consider a donation to Koushik.
After all it is thanks to his (and the many other developers) work and readiness to share it that I can write these programs. I (currently) still get enough satisfaction in writing these programs.
just tested, awsome little game! keep working on this! perhaps add some vibration and sound feedback, maybe change the dots to somthing like a mouse and some cheese? if you changed it to a ball it may be too simaler to teeter?
Adam
cgeboers said:
Question:
When I try to use MessageBox from my code, the MessageBox fails to close and I can never get back to the Shell without a reset. Any one any idea what I could be doing wrong here ?
Click to expand...
Click to collapse
I haven't had any issues using C#.Net ... what are you writing in? The only thing I can think of is to make sure the MessageBox is shown from the same thread that created the form.
Really like the concept - gave it a play, and it works well! Looking forward to new and improved versions!
Great, Cheers dude
Some screens would be nice!
SensorMaze - suggestions
Thanks for the reviews. I will implement the changes, like the mouse and the cheese. I am currently working on an other "gadget" application, as soon as that one is finished I will take care of it.
As for the question about the MessageBox, I use C++ in this program and have a workaround, so I will let it at rest for the moment.
I will try to get some screendumps too later.
cgeboers said:
I wrote this little program, called SensorMaze. It generates mazes and allows you to steer a little blue dot using the movement sensors in the HTC Diamond. It is based on the original SensorTest program and since it has been a while since I programmed for any PDA, it is a bit simple.
Usage:
Try to send the blue dot to the red dot by tilting your Diamond in the required directions.
Commands:
- New Maze: create a new maze in the same level
- Next Level: increase the complexity.
As mentioned, it is my first attempt, so there is still some work that needs to be done.
TODO:
- Implement timer, so you can compete against yourself
- remove the "Position" text and replace with timer output
- MessageBox instead of Dialog ?
- Replace the blue dot with a "ball" like structure
- Release the source code (after cleaning it a bit more)
Question:
When I try to use MessageBox from my code, the MessageBox fails to close and I can never get back to the Shell without a reset. Any one any idea what I could be doing wrong here ?
Changes ( 07-Aug-2008)
- Replaced the target with a cheese and the moving dot with a mouse icon.
- Added some text to show the current level.
- Initial level is lowered, so that kids could play it too.
Screenshots are provided in the attached .png files. I also added the sources, so that other people can see how you can use the acceleration meter
Click to expand...
Click to collapse
have other sensor game.
SensorMaze mouse
I love this little game. However I found that in challenging myself and advancing the game to higher levels, the little white mouse became rather difficult to see as he became smaller. Perhaps changing the colour f the mouse or the colour of the paths in the maze. Currently the mouse and the maze are the same colour. other than that the game is great.
Awesome program, but I feel like I'm epileptic now, the screen was constantly flickering during it, I think it's a compatibility issue with my Raphael.
Awesome program
hmmm...wasn't able to get it working.
Got error (Unable to load Sensor DLL).
Any ideas?
sensor
unable to load DLL? can u tell me how to fix it?
that's a fun little game, thanks
Nice man : D
Hi, when i try to lunch the game, i got sensor dll, what shell i do to run the game ? i have samsung omnia i900
fadoody said:
Hi, when i try to lunch the game, i got sensor dll, what shell i do to run the game ? i have samsung omnia i900
Click to expand...
Click to collapse
you need to replace the sensor.dll file with the Samsung's...it is preinstalled with HTCs. Change that file and it should work fine.
I replaced sensor.dll with Samsung's .. but the problem is still persisting.. what shall i do now?
It would be nice if this could work on our LGs.
(the working LG sensors.dll created by iamspv at thread number 471591 in this forum.)
Hi All Site Engineers out there,
I had searched for ages to find an app for windows mobile devices that quite simply calculated either new grid co-ordinates from a know point given its bearing and distance or to calculate a bearing and distance given two known points.
I had written a program for a personal computer using (BASIC) but why carry a phone and a computer with you on a building site!
I couldnt find one that was simple, meaning less mistakes when "in the field", so Gino wrote me one. Feel free to download, use and change. Many thanks to GinoAMalone for this simple app, so please donate to either him or XDA of course
The app has a simple home screen giving you 3 choices:
1. New Co-ords Calculator
2. Distance & Bearing Calulator
3. Pythag Calculator
The app is tested on Touch Cruise 6.0 & 6.1, Prophet 6.1. & Blackstone 6.1 & 6.5, Touch Pro & HD2.
Other devices not tested so please give feed back & Screen shots to come.
UPDATE: December 2010: This App has now been written for Android also, please head over to this for info and give thanks to Captainkrtek & Scary Alien
How's this...
Here's a first pass at the app. This sounded like an interesting challenge and something to get me started learning more of WinMo programming. This is my second or third app for .Net. This is written in C# and should only need CF .Net 2.0.
I still need to clean up some rough edges. Right now it doesn't do anything about formatting the output how you requested and most input errors will cause it to crash.
I'm not sure if it's using the same distance algorithms you used. I got my code from http://www.movable-type.co.uk/scripts/latlong.html and http://bryan.reynoldslive.com/post/...2c-Cardinal-Direction2c-Distance2c-and-C.aspx. The algorithm I used is called the spherical law of cosines on the first link.
But, let me know if it looks like the sort of thing you need. I'll PM you with my email address.
Thanks,
Gino A...
Update [20 mins later]: I had a boneheaded mistake in the CAB. Fixed now.
GinoAMelone said:
Here's a first pass at the app. This sounded like an interesting challenge and something to get me started learning more of WinMo programming. This is my second or third app for .Net. This is written in C# and should only need CF .Net 2.0.
I still need to clean up some rough edges. Right now it doesn't do anything about formatting the output how you requested and most input errors will cause it to crash.
I'm not sure if it's using the same distance algorithms you used. I got my code from http://www.movable-type.co.uk/scripts/latlong.html and http://bryan.reynoldslive.com/post/...2c-Cardinal-Direction2c-Distance2c-and-C.aspx. The algorithm I used is called the spherical law of cosines on the first link.
But, let me know if it looks like the sort of thing you need. I'll PM you with my email address.
Thanks,
Gino A...
Update [20 mins later]: I had a boneheaded mistake in the CAB. Fixed now.
Click to expand...
Click to collapse
Hey Gino,
THanks for the app. have given it a test and come up with error on coords and vector parts:
"latitude value cannot be greater than 90"
ALso suggestion, can you also have metres and millimetres as units too? sounds daft maybe, but if working out bearings and new co-ords for setting out a building units would be in metres or mm. This woud prob explain the latitude error.
Also when im inputting in the bearing how should it be inputted? like this: 95'32'25' ?? or have you done in decimal.
Ok, after thought. I know the reason why the latitude error occurs, its beacuse the co-ords input is in degrees, minutes, seconds. I would need an option for co-ords based in meters for example, easting=500.735 northing=345.321 This is important when calculating results for buildings setting out. Can you please put an option in for this, or even purely base the program in metres/mm rather then degress. Obviously the bearing would still need to be in degree, minutes & seconds.
Thanks Gino, the app looks great and im sure with minor tweaks you will have it running in no time!
What about a simple GPS related program which allows you to put in waypoints? It'll give you the distance, heading, etc.. Most of them you can also do offsets of X distance and Y heading, etc..
They do not imply having or using the GPS. Generally you turn the GPS on if needed, but you could use the coordinate related stuff without it.
khaytsus said:
What about a simple GPS related program which allows you to put in waypoints? It'll give you the distance, heading, etc.. Most of them you can also do offsets of X distance and Y heading, etc..
They do not imply having or using the GPS. Generally you turn the GPS on if needed, but you could use the coordinate related stuff without it.
Click to expand...
Click to collapse
Khaytsus thanks for your thoughts. I dont think the GPS is the way to go with this. Yes it would calculate distance and bearing, but i need to input grid line references (co-ords) like 500 metres east, 200 metres north. the calculations in my basic code are based on a 2d grid line system. the app would not need to to use gps. Sometimes when working out co-ors or bearing and distance for setting out a building, the distance from 2 given points could be 100 metres but anything as little as 3 metres. GPS may not provide 1mm accuracy.
If my code was used in the app, it would work, i know it does as i have used it many times before. dont think about curvature of the earth or lon & lat think more grid lines like a flat map. see next post for example.
BASIC - code
Ok my BASIC code below, also attached is a simple (apols) jpeg of what the app should be doing. You will see a red house situated in a grid line system, with its grid co-ords above the relevant point. Hope this is of some help to Gino and anyone else
Code:
To Calc New Co-ords
10 print "New Co-ords"
20 input "Easting=",A, "Northing=",B
22 input "Bearing=",C, "Distance=",D
30 F=sinC*D+A
40 G=cosC*D+B
50 set F4
60 print "Easting 1=";F; "Northing 1=";G
65 goto 22
70 End
To Calc Distance & Bearing
10 print "Bearing & Distance"
20 input "E0=",P,"N0=",Q
30 input "E1=",A,"N1=",B
40 C=A-P
50 V=ABS(C)
60 D=B-Q
70 W=ABS(D)
80 if C=0 then 210
90 if D=0 then 260
100 if C>0 then 160
110 if D>0 then 140
120 E=(ATN(V/W))+180
130 goto 300
140 E=(ATN(W/V))+270
150 goto 300
160 if D>0 then 190
170 E=(ATN(W/V))+90
180 goto 300
190 E=ATN(V/W)
200 goto 300
210 ifD>0 then 240
220 E=180
230 goto 300
240 E=0
250 goto 300
260 ifC>0 then 290
270 E=270
280 goto 300
290 E=90
300 H=(C~2+D~2)~0.5
310 print "Bearing=";DMS$(E)
320 print "Distance=" H
330 End
please note symbol "~" means to the power of (could not find the proper symbol on my keyboard)
also DMS$ = degrees minutes seconds (the new bearing should be displayed in this format, not in decimal)
ATN = (shift tan on sci calculator)
ABS = (shirt LOG on sci calculator)
Pythag Calculation
10 print"Pythag"
20 input "side A=",A,"side B= ",B
30 C=(A~2+B~2)~0.5
40 print "Hyp= ";C
50 goto 10
60 end
timmymarsh said:
Khaytsus thanks for your thoughts. I dont think the GPS is the way to go with this. Yes it would calculate distance and bearing, but i need to input grid line references (co-ords) like 500 metres east, 200 metres north. the calculations in my basic code are based on a 2d grid line system. the app would not need to to use gps. Sometimes when working out co-ors or bearing and distance for setting out a building, the distance from 2 given points could be 100 metres but anything as little as 3 metres. GPS may not provide 1mm accuracy.
If my code was used in the app, it would work, i know it does as i have used it many times before. dont think about curvature of the earth or lon & lat think more grid lines like a flat map. see next post for example.
Click to expand...
Click to collapse
Aha, okay. I was thinking larger scale, less precision, etc. I have to 'deal' with northings and eastings every time I look up benchmark documentation and I always have to figure out how to convert it.. Grid, datum, etc..
Hi Guys,
Any updates? Please dont think im impatient, im certainly not, just willing to help in anyway i can
Regards.
timmymarsh said:
Hi Guys,
Any updates? Please dont think im impatient, im certainly not, just willing to help in anyway i can
Regards.
Click to expand...
Click to collapse
I didn't get as much time last weekend to make progress as I hoped. I did do some cleanup of the UI and add several more units. I believe there are no more circumstances where poorly formatted input causes crashes. I also eliminated the "calculate" button and have it calculate whenever enough info is available. The biggest motivator for this was so the UI works fine with a SIP open.
I still need to look at formatting the output and spend some time with your algorithm.
Thanks for the challenge. this is working as an excellent vehicle for me to learn about .Net CF programming.
try G7toCE
http://www.gpsinformation.org/ronh/
this javascript page will run offline in PIE
http://williams.best.vwh.net/gccalc.htm
GinoAMelone said:
I didn't get as much time last weekend to make progress as I hoped. I did do some cleanup of the UI and add several more units. I believe there are no more circumstances where poorly formatted input causes crashes. I also eliminated the "calculate" button and have it calculate whenever enough info is available. The biggest motivator for this was so the UI works fine with a SIP open.
I still need to look at formatting the output and spend some time with your algorithm.
Thanks for the challenge. this is working as an excellent vehicle for me to learn about .Net CF programming.
Click to expand...
Click to collapse
Gino,
Thanks for the heads up, the app is comin on great. Did you understand my rarther poor explanation of what i meant about inputting the grid line co-ords and did my crude diagram help? I am very thankful and glad i am able to help stimulate you grey cells Get back if i can be of any help please.
Hi All,
Does anyone else want to have a go at this, seems to have fallen by the wayside
As stated in the first post, i will help in any way i can, test and donate of course!
Good luck!
Take a look at this try.
GinoAMelone said:
Take a look at this try.
Click to expand...
Click to collapse
Gino,
Well done my friend, i think you have cracked it. I will test it for accuracy when at work monday with results i know are correct (simple tests like 500.000E & 200.00 N with bearing 90 and distance of 100) work fine.
I see the bearing is entered in decimal, which is not a problem, but it is favourable to enter it in DMS (saves having to calculate this before hand) for example 45o30'00'' (which is 45.500 in decimal)
Really brilliant and im very pleased, let me know if the DMS thing is possible? Cheers Gino.
The labeling of the bearing fields isn't entirely clear. But, it's looking for Degrees, Minutes and Seconds.
I'm pretty sure I'm doing the DMS conversion correctly, but don't trust it till you've tested it. Let me know if it's right.
Thanks.
Gino,
Many thanks my friend, the app with the bearings works very well (dms works). One final thing, could you set the eastings and northings to be rounded up to 3 decimal places for example 500.216 and not 500.21578767.
That would make the app perfect
Well done, you know there is market for this app if you are interested?
I rounded all outputs to three digits.
I've also put a BSD license on this. So, you're free to share it with others if you want. Also, they'd be free to make changes.
If anyone wants to tip me for it, I won't object.
I can't figure out how to do the cute little PayPal button in an XDA post. https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=3275014
Congrats to a sucessful app Gino, get that button working and i will happily donate!! I will have a look and see if i can get it working for you!
I too am a site engineer and produced an excel spreadsheet to calculate bearing and distance about 10 years ago. I have just tested and it works on the touch pro so I have attached it here in case it is of use to you.
dougalls said:
I too am a site engineer and produced an excel spreadsheet to calculate bearing and distance about 10 years ago. I have just tested and it works on the touch pro so I have attached it here in case it is of use to you.
Click to expand...
Click to collapse
Kool, nice one Dougalls!! the more the merrier!! Have you tested Gino's app? I did some brief testing and it appeared to give accurate results, but test it and let me know on here please!