[SDK] Access G-Sensor / Accelerometer On HTC WM Devices - Windows Mobile Software Development

This code enables you to use the g-sensor on a HTC WM device, without any depencies og DLL's.
This can be compiled directly into you applications. (Less DLL clutter)
I made this by nitting bits and pieces of code together from the www.
The code runs pretty fast, but I would like to optimize it, to make it even faster.
Allso, this depends on a Timer to poll the Sensor.
I would rather have it event based or something.
Thats your job
Do whatever you want with this code.
It you make any enhancements though, please upload then to the XDA Developers website.

thanx for sharing! great job - I will look into.
Micha

Related

I really want to develop software for the XDA but....

I Really Really Really want to develop some stuff for the XDA (I have been doing this sort of stuff for over 25 years!!) but I am not sure if Java would be best or C++ (I am dead good in both)
I know java like the back of my hand
and Borland C++ the same but I do not know Visual C++ at all (I have had a look and don't like what I see)
I am having REAL troubles finding out anything - Can anyone help :?:
A few pointers in the right direction would be great!!
Java has the adavantage of being portable but the packages avaialble are poor (only AWT it seems)
C++ would be great but it seems that you can only use Visual C++ (which is as visual as a blind man on a charging horse)
I need to be able to develop database-type applications with nice pretty controls such as Text Fields List Boxes and the like.
There is a beer in it for anyone who can help
Some options:
Java: no-go - there is no built in JRE on the XDA, so you'd have to count on your users to buy a third party one like Jeode or Creme.
C++: yes Visual C++ doesn't really provide a full visual toolkit, compared to the Borland IDEs, but it's the best performance-wise, and applications will run with minimal install on XDAs
EVB: Have you tried the embedded VB environment - it makes producing programs a doddle with a good screed designer etc, however performance is a dog as it's interpreted. Also access to API functions is difficult, and in a lot of cases (callbacks etc) impossible.
.NET CF: This might be the answer to your problem. You can develop applications using VisualStudio.net for the compact framework (ie the PocketPC) in either VB.Net or C#. The IDE is everything you'd want. The runtime is distributable (although it's 1.5B), but it's currently quite show. Strangely, you can't currently use C++.Net for the CF, but reportedly ths will be rectified soon. It's also quite costly.
So:
- for power, performance and code size, but missing ease of use: eVC
- for ease of use and code size, but limited power and low performance: eVB
- for ease of use and power, but lacking performance, and a 1.5MB CF install: .NET
Judging by your requirements for database style development, and your experience with C++, I'd recommend using C# and the .Net CF
If you don't want to invest in visual studio 2003, then go with eVB, but bear in mind eVB is being phased out and will be unsupported on PPC2003 devices.
hi
Dive into eVC++. Yes it is a pain to get started but you can do anything in it. I do most of my development for desktops in qt so it was a real pain to learn MS weird ways but it is not so bad and it is the only alternative.
Cheers
Ian Bennetts

Help for "RIL" source code?

Hi
I'm a skilled VB/C# (so and so in C++ !) programmer
I'm looking for the shortest and easiest example code for test the RIL interface of my XDA 1.
Somethingh like "place a phone call"
Did someone ever developed an RIL ActeiveX for speed up the Phone apps develpinh?
Thanx in advance
see this test program, showing how to call ril functions.
or this class ( this is part of a large project, the rest of the source is not here )
Itsme said:
see this test program, showing how to call ril functions.
or this class ( this is part of a large project, the rest of the source is not here )
Click to expand...
Click to collapse
Thanx. It helps a lot!
Do you know about any other example made with eVB?
I recently tested a small "alpha" application called "Phone Plus" ( http://www.mesoftware.co.nr/ )
It's in early stage of developing but is interesting the possibility to use eVB for Phone applications that place directed calls to the basic RIL functions and maybe use an eVC ActiveX for the complex and "deepest"
ones.
Sounds logic? Any other better (fast) approach?
Bye

CorePlayer Skins... We Need Help!

All.... we have been working hard on CoreUI over the past 6 months. If your not familiar with CoreUI let me explain what it is. CoreUI is the Universal user interface (skins) behind CorePlayer. For developers think of it as a lighter, faster, smaller and more universal approach to skinning your applications compared to GTK or QT.
Even though we are still working on some of the design elements in CP. We are at the point now that we are comfortable to finally let skin developers start to work on skinning CorePlayer.
Now I want to say CoreUI is more then just a 'skin'... it is an XML based modular widget UI that gives you unlimited power to everything within CorePlayer.
So what will you need?
- Photoshop (or me with paint.net)
- XML experience is a MUST for skin designers
- Time to read through the 60+ page UI documentation
- Patience...
Anyone that wants the latest CoreUI skin documentation can email me ( info AT corecodec DOT com ) and I'll send it to them... as we want to work directly with the skin designers so, serious inquiries only.
Also I want to note... we are willing to pay $100 or more per skin! (now I got your attention)
Lets get to skinning!

Language of choice

Just curious..What is everyone's programming language of choice when developing apps for WinMo?
Ive been working (lightly) on a VB program, which is ok, but i feel it isnt as efficient as others might be, and i know efficiency and size is a big issue on mobile devices (obviously)
Depends:
A simple program or one that can be done just using the stuff in the standard system DLLs then I will go for the pain of coding it in WIN32 C++. The resulting application runs like the wind, and can be distributed as a single executable file, no CAB, no installation projects, etc etc.
If I need any web or fancy data functionality, then it is .NET, because it is not worth the hassle of getting all this to work from levels lower down.
Having had lots of previous coding experience in C/C++ then C# is the natural choice, but as far as .NET is concerned, the actual language you code in is irrelevant. It compiles down to IL anyway and the CPU 'JIT' compiles this into its own code before it runs. Hence the performance hit when the program starts and runs.
In .NET, in essence, all you are doing anyway, is creating .NET objects, setting their properties and calling their methods, in order to get them to do what your application requires. A simplistic view, I know, but that's is all there is to it!
The language that you use to do this doesn't really matter, it is just personal preference.
I guess i assumed one language had more efficantcy than another. Like im working with VB atm, and i know it simplifies alot of things to make it easier to use, not sure if it includes all that extra code in the final build or not tho.
I would like to get more pratice with C++ and i have yet to use C# so dono whats different about that.
I would like to eventually start making programs that utilize the .net code and get my programs talking though data on the phone, but im not that advanced yet.
currently im still trying to wrap my head about making a program with a local database. The program im working on currently doesn't store any data, but i would like to to. I would also like (if i get ambitious) to have that program possibly talk to a PC (parent) program and sync with it. But that i think is a ways off.
Also, do the Mobile SDK's look different? The program im working on i started in the 5 SDK, but (obviously) doesnt have Finger friendly IU tools. I haven't looked at the 6/6.5 SDK yet (as id have to start over again i think). Does it have more finger friendly options?
In .NET CF, the finger-friendlinnes and kinetic scrolling and this all isn't available for all controls. Most of them (the classic ones) are, but if you try using scrolling for whole form, it won't work, only scrollbar will. (Probably with some playing with physicsengine and marshalling you might be able to get it working here, too).
In C++, there are numerous examples of this gestures etc directly in SDK, also many other stuff is there.
See, the main difference here is that .NET is fully equipped with stuff to get everything done fast, easy way.
In C++, you must first make this way yourself .
i am using the .net 3.5 framework tho.. Unless you mean C++ vs C#. I thought .net was an expansion on a current language, and not a language on it self (meaning i cant choose to program in .net, its an option to VB, C++ or C#)
I did toy with it, and it appears as tho your right, the forums are the same. IE drop down/combo boxes are not finger friendly. Guess id have to turn it to a button and another form with large radio button options.
C# vs C++ main difference is that C++ is compiled to native code right on first time, which makes it very fast. C# is compiled to MSIL, which is NOT native code yet. When you run c# app, the code is being Just-In-Time (JIT) compiled to native code, which makes it "longer" to load and "slower" to run (usually that makes about 20% of speeddown on classic PCs with very optimalized C++ same code - it probably already is lower, this is a bit older result of testing).
C# has those nice features that it can't get out of its memory etc, the JIT is almost unhackable, so you can't write viruses in it etc.
As far as the SDKs are concerned, there are slight differences from one version to the next but they can be quite difficult to spot.
They can become issues, when code written to run on one platform is run on one several generations away. I have a program that was written in C++ WM2003. Works under all versions of WM until 6.5.3, when the About Dialog box fails to close if the (X) button is pressed. Turns out another value has to be added to the dialogbox flags field to get it to behave properly.
This has been a feature of SDK's from WM 5.0 onwards, but the WM2003 SDK is unaware of it. You have to add it manually to the shell code created by the SDK,
Progress I suppose. The full article is here:
http://forum.xda-developers.com/showthread.php?t=635063
Treo 700xw Verizon Spanish language
Hello fellow .... I'm new to this forum
I have a Treo 700wx and I live in Mexico ...
My Treo is Verizon's company and is currently with the version 1.22 ...
My problem is that it is in English and I need to change the language in Spanish ...
Thank you for your support both the need
Greetings
stephj said:
As far as the SDKs are concerned, there are slight differences from one version to the next but they can be quite difficult to spot.
They can become issues, when code written to run on one platform is run on one several generations away. I have a program that was written in C++ WM2003. Works under all versions of WM until 6.5.3, when the About Dialog box fails to close if the (X) button is pressed. Turns out another value has to be added to the dialogbox flags field to get it to behave properly.
This has been a feature of SDK's from WM 5.0 onwards, but the WM2003 SDK is unaware of it. You have to add it manually to the shell code created by the SDK,
Progress I suppose. The full article is here:
http://forum.xda-developers.com/showthread.php?t=635063
Click to expand...
Click to collapse
I noticed something else odd. When i run the app on my pone, the resolution is off. Now everything looks ok, i just mean that when i run it on my phone, theirs alot of "white dead space" at the bottom. I can only guess this is due to the SDK's catered to phones with smaller screen resolutions (ie Touch Pro) with buttons.. Is their a way for me to switch the resolution to ultilize the full Touch Pro 2 screen size (480x320 i think)?
Funny you should mention that. I replied to a similar post a short while ago. I'm not going to type it all in again, it's here.
http://forum.xda-developers.com/showthread.php?t=637417

[DEV] Complete UI Rewrite

Hi there,
since i'm searching for a fast and customisable ui since months (90% of them use sense what makes them kind of slow). So I decided to start such a Project on my own.
My main targets are:
- Speed (!!!)
- User-friendly design
- Customizable Widget support
- High built in application support (native support of different music players, browsers and more)
I am going to use .NET Framework 3.5 and delop it using the WM home plugin system.
Since this UI is going to be freeware i'm going to try out this graphics libary (WMGL):
http://www.mobilityflow.com/products/wmgl/
The following shows the current progress and prioritys for planned features.
Current information:
- 2010/10/08 -
I will start development this weekend, for the beginning this will be a solo project. After development of the base system I would be glad about some help, but at that time there will already be progress that shows work on this project really makes sense
- 2010/10/10 -
Spent almost the whole weekend with coding and it was worth it! For now there are already 3 Desktops (configurable via XML) with different wallpaper modes (raw, fit, panorama). In panorama mode the image will be scaled (keeping proportions) over all 3 desktops. Basic widget engine is almost done, already got a first button widget that displays a free scalable graphical button (you can define a border width that will not be completely scaled). Also there is a label element to output text on a widget (the button label).
Here a few seconds of demonstration with 3 different scaled and positioned button widgets and a 1024x768 default windows desktop in panorama mode:
http://www.youtube.com/watch?v=OZ2zCN2BNno
And it will be independent to the device's resolution, like seen here it already works with other today plugins together:
http://www.youtube.com/watch?v=22f3GClKC94
- 2010/10/11 -
Finished and optimized a lot of things today, most important changes are lots of font settings (color, bold, underline, italic, size, h-align, v-align), basic mouse events (down, up, click) and a few actions for those events (show/hide image, open url/file, open ui-dialog). Here a short video of the current version: http://www.youtube.com/watch?v=Zk1Mgmj4HAg
- 2010/10/20 -
Debugged and cleaned the whole code, couldn't find any problems with the current features anymore. Also improved the performance a bit. Added icon's as source for widget images for application shortcuts (icon not scalable! size depends on the device, the wm5 emulator uses 32x32 modern phones usally 64x64). Added a small pager that displays the active desktop. Replaced the button graphics by high-res one's (I know they're not that beautyful ). Here's a video snapshot of that version: http://www.youtube.com/watch?v=c4KQ5s-NxtQ
- 2010/10/24 -
Done some pretty effective performance optimizations and increased the desktop scroll speed some. Replaced the button graphics again but I'm still not that happy with it. Added the most common status widgets (calls, texts/sms, mails) including the matching shortcut. Added a first small digital clock widget (160x80) somehow the clock was not correct when using the emulator, when using my own phone it works perfectly. Here's the video: http://www.youtube.com/watch?v=h2Ur4PrBsSA (reuploaded video, working now)
- 2010/11/03 -
Replaced the graphics again, this one will be the base for the first (stock) skin. The battery icon will be replaced by a black one later. Further added 3 status widgets showing the battery state, signal strength and memory usage. To give a better view (without problems caused by the emulator) I made a video of it running on my HTC Touch Diamond 2 (Topaz). Here's the video: http://www.youtube.com/watch?v=_cIdAYtKnPA
Implemented features:
Desktops
3 Desktops (configured using xml) with independed wallpapers. (Still some todo's)
Widgets
Alert widgets (Calls, Texts, Mails)
Status widgets (Battery, Radio, Memory)
Digital clock widget (One small and one large)
Graphic button widget with text label and/or icon. (URLs, files, applications and a few system functions)
Planned features:
Desktops
(HIGH) 3 freely editable desktops with unlimited widget count / variation.
Widgets
(HIGH) Alert widgets (Calls, Texts, Mails, News!)
(HIGH) Contact widget (different layouts, supporting displaying multiple contacts and filtering)
(MID) Mail- and text-widget (incl. browsing and marking them read)
(MID) News widget (RSS)
(MID) Music widget (with multiple player support)
(LOW) Social widgets (Facebook, twitter, ....)
Tools
(HIGH) Tool for layout backups
(LOW) Update checker
PS: I know there are already many UI's out of there and coding a new one won't make sense for some of you, but imho there is still no really good one out there (at least not for a reasonable price). The most close one is MaxSense, but that mod still drains tonns of memory for sense and is also a bit buggy and limited. (e.g. there is no way to add the same widget twice)
Since i'm not expecting a fast port of WM7 to older devices this is going to be optimized for WM6. Anyway all WM5+ devices should be capable of running this UI.
Best regards
Forsaken
Developer Notes
In this section i will write down things that experienced users (and developers) might want to know.
XML structure definitions
desktop.xml
Code:
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<config>
<desktop>
<wallpaper file="relative\path.jpg" mode="raw|fit|panorama" />
<widgets>
<!-- If posx, posy, width or height are set to 0 these values
are taken from the widget.xml if available -->
<widget file="widgets\widget.xml" posx="0" posy="0" width="0" height="80" />
</widgets>
</desktop>
<desktop>
<wallpaper file="relative\path.jpg" mode="raw|fit|panorama" />
</desktop>
<desktop>
<wallpaper file="relative\path.jpg" mode="raw|fit|panorama" />
</desktop>
</config>
widgets\widget.xml
Code:
<?xml version="1.0" encoding="utf-8"?>
<widget width="80" height="20">
<images>
<!-- Images are currently not positionable, if another mode than raw is
set the image will be scaled to fit the widget size.
The border attribute is optional and will only be used for fit_border -->
<image file="relative\path.png" mode="raw|fit|fit_border" border="8" />
</images>
<labels>
<!-- Labels are currently not positionable, too. ;)
The text is just centered into the widget. -->
<label text="About" />
</labels>
<events>
<!-- Coming soon ... -->
</events>
</widget>
+1 for sqvga!
This sounds great!
Looking forward to see your work
I wouldn't say they are slow because they "use" Sense (though I personally hate this tendency to write UIs emulating Sense... not everyone has an HTC phone!) they are slow because they are .NET/C# and unoptimized. If you ask me C# isn't fit for anything that needs to be fast or run permanently... Nothing beats native code in terms of performance. If you want optimization you'll have to go with C/C++... Good code eliminates the need for exaggerated phone specs.
As for renders RawFramebuffer seems to be the best generic bet (GDI is slow) it's not optimal there's no consensual best... Intel Xscale is the best for phones with good old CPUs (not HTC) and OpenGL ES is the best in most new phones.
Homescreen++ is C/C++ but renders in GDI... AFAIK it's the only free today screen plugin in native code (making it one of the lightest) while still being very flexible (though lacking some of the recent features in this sort of UI... which Mortscript can somewhat compensate for). One of my all-time favorite free apps (together with Mortscript, TCPMP, GSFinder+ and WKTask).
Just my 2 cents anyway...
Good luck.
..so this topic is about another manila/spb bs?
shame.
for conscoius users i can recommend: hs++ + mortscript.
rest - go and buy iphone/android.
I am going to use .NET Framework 2
Click to expand...
Click to collapse
dude, wake up. you must be fresh or kidding for bump.
regards,
nothin.
pupakota said:
..so this topic is about another manila/spb bs?
shame.
for conscoius users i can recommend: hs++ + mortscript.
rest - go and buy iphone/android.
forsaken said:
I am going to use .NET Framework 2
Click to expand...
Click to collapse
dude, wake up. you must be fresh or kidding for bump.
regards,
nothin.
Click to expand...
Click to collapse
You're right about .NET 2.0, i will definitly need 3.5. And i won't use only .NET libarys, of course i will try to say native
About iPhone...
About Andoid, i dont have money for a new phone yet And it's about time for a free powerful ui
Only the behavior of the desktops is like andoid, i will definitly not just copy another system. Especially the widgets will be a lot different than those i saw so far.
Anyway coding is my hobby and i'm really motivated for this project. It's fun so far and I'm already making some progress. I got already 3 smoothly slideable desktops with a hard-coded wallpaper, even there is nothing on it yet
I also decided to support any possible resolution, maybe i will even get it working with other (smaller) today plugins together.
Since 2AM here i'll take a rest for now
Wish me luck for tomorrow, I will start to implement a XML-Parser for the desktop-configs and widgets.
Best regards
Forsaken
Good luck, then
And sorry for tone of my previous post.
Have you thought about your project license? If you decide to go open-source you could find TodayLife a big help for ideas/examples/code...
frmariam said:
Have you thought about your project license? If you decide to go open-source you could find TodayLife a big help for ideas/examples/code...
Click to expand...
Click to collapse
Hmm it will definitly be freeware, personally I would like to go open-source but first I will have to check out the licenses of the two libarys I am going to use.
WMGL, a very fast graphics libary: http://www.mobilityflow.com/products/wmgl/license
Free to use with a linked hint that the app uses it. (For freeware)
A small native C++ XML Libary unter CPOL: http://www.codeproject.com/info/cpol10.aspx
I would be glad about an advise, regarding licensing I really don't have a clue yet
PS: Some first videos of my current status above The progress already exceed my expectations for those 2 days of work ^^
I'm wondering how you want to use .NET 4+, when for WinMo is available only .NET CF 3.5 (and something called 3.7?).
For this stuff, I'd really drop any .NET part and do it purely in native code. On the other hand, .NETCF isn't slow actually. What is slow, even in native code, is the GDI+. You MUST use OpenGLES, otherwise you'll fail pretty hard. TouchXPerience is all built in .NETCF using OpenGLES and it runs quite fast.
You can take a look at TigreSDK, but I found out that with few objects on screen, it runs slower (2D text object). I had working physics engine for that though. That's where I ended because of the speed of rendering. Next time I will go for native even myself.
OndraSter said:
I'm wondering how you want to use .NET 4+, when for WinMo is available only .NET CF 3.5 (and something called 3.7?).
For this stuff, I'd really drop any .NET part and do it purely in native code. On the other hand, .NETCF isn't slow actually. What is slow, even in native code, is the GDI+. You MUST use OpenGLES, otherwise you'll fail pretty hard. TouchXPerience is all built in .NETCF using OpenGLES and it runs quite fast.
You can take a look at TigreSDK, but I found out that with few objects on screen, it runs slower (2D text object). I had working physics engine for that though. That's where I ended because of the speed of rendering. Next time I will go for native even myself.
Click to expand...
Click to collapse
Yeah you're right it's going to be 3.5 ^^ I started to mix up the .NET Framework and .NET Compact Framework. The project is set to the 3.5 version. I just corrected it in the main thread, too. Thx for the hint
good Luck!
Forsaken,
Good luck on this! I don't code, so feel like a leach sometimes. BUT, I am willing to sacrifice (dont tell the wife) my phone for testing, and have helped a few guys over here and currently am doing some testing as well with thier themes and UI's.
I am too old of a dog to learn a new trick (my last one was called COBOL!), but at least I can offer testing information.
With that said, if you ever need a tester for another phone, I am running an HTC Imagio with Stock Verizon ROM, running WM6.5 and Sense 2.1 on a WVGA screen.
Good luck, and looking forward to what you can come up with!
JerryA said:
Forsaken,
Good luck on this! I don't code, so feel like a leach sometimes. BUT, I am willing to sacrifice (dont tell the wife) my phone for testing, and have helped a few guys over here and currently am doing some testing as well with thier themes and UI's.
I am too old of a dog to learn a new trick (my last one was called COBOL!), but at least I can offer testing information.
With that said, if you ever need a tester for another phone, I am running an HTC Imagio with Stock Verizon ROM, running WM6.5 and Sense 2.1 on a WVGA screen.
Good luck, and looking forward to what you can come up with!
Click to expand...
Click to collapse
Thanks for your kind offer, I will come back to that for sure
But for now testing won't make much sense, it's just too early.
-- Update:
I just finally finished another chapter (extracting the icon of other applications for shortcuts) and spent much time with cleaning and commenting the code.
Also added a more detailed update to the first post, for lazy one's here a video of the current state: http://www.youtube.com/watch?v=c4KQ5s-NxtQ
Like the updates. Like I said, its just cool that you guys can do this stuff!
Thanks for keeping me in mind, drop me a PM whenever your ready. If I cange phones or anything, I will be sure to let you know!
Here I go again, did some bugfixes causing a high system load and made some new graphics again . Added 3 status widgets showing the battery level, signal strength and memory usage.
For more details see the first post, here the video: http://www.youtube.com/watch?v=_cIdAYtKnPA
At the current rate I will release the first beta version in a few weeks. Until that I will have to figure out a problem that occurs after unloading / loading the interface a lot (desktop process crashes, regular restart needed to get it working again). While testing the normal usage this didn't happen so far. Further i will implement the remapping of application buttons before releasing a beta version.
For now those shortcuts are set up using the xml configuration file.
Hi, really appreciate your efforts, and I encourage you.
What I can tell as a user of TG01 and Acer S200 phones : WVGA phones with 256mo of ram doesn't run well because of lack of memory.
Everybody knows that WM built-in startmenu is very very RAM hungry, on WVGA devices, it can easily hit the 20-35mb of ram usage due to icons caching and other things... thats incredible!!!!
So in my mind, the must have of your UI is a complete WinMo UI replacement, that completely overhads startmenu and kills his memory usage, this would make your UI the best one.
looking good!
Forsaken said:
Here I go again, did some bugfixes causing a high system load and made some new graphics again . Added 3 status widgets showing the battery level, signal strength and memory usage.
For more details see the first post, here the video: http://www.youtube.com/watch?v=_cIdAYtKnPA
At the current rate I will release the first beta version in a few weeks. Until that I will have to figure out a problem that occurs after unloading / loading the interface a lot (desktop process crashes, regular restart needed to get it working again). While testing the normal usage this didn't happen so far. Further i will implement the remapping of application buttons before releasing a beta version.
For now those shortcuts are set up using the xml configuration file.
Click to expand...
Click to collapse
Looking good! Like the speed and smooth transitions. Again, keep up the good work!
May be too flippin early for this, and again, I can't code. But here is a sugestion regarding the battery and signal meters. What about making certain widgets or icons 'lockable' so that whenever you switch screens, they remain (like the signal meters or clocks?).
Like the advances so far, and really like that background image. Great to see how far you have come along!
any update for this great UI? is there posible to get rid the winmo bottombar later?

Categories

Resources