[SDK]HD2MultitouchSDK - HD2 Windows Mobile 6.5 Themes and Apps

Beta-Version is out!!
Multitouch for everyone!!!!
HD2Multitouch is for all who want to support multitouch on the HD2 in their apps like the Album-App does.
This is the really first version, so don't expect a perfect solution....
And it's free, so start developing....
Getting started:
Code:
public YourForm()
{
InitializeComponent();
bool doRestart;
multitouch = Multitouch.GetMultitouch(this, out doRestart);
if (doRestart)
{
MessageBox.Show("To activate the multitouch, the app will perform a restert now.", "Multitouch", MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1);
Multitouch.PerformSoftReset();
this.Close();
return;
}
if (multitouch == null)
{
MessageBox.Show("Failed to initialize the multitouch.", "MultitouchDemo", MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1);
this.Close();
return;
}
multitouch.TouchDown += new EventHandler<MultitouchEventArgs>(multitouch_TouchDown);
multitouch.TouchUp += new EventHandler<MultitouchEventArgs>(multitouch_TouchUp);
multitouch.TouchMove += new EventHandler<MultitouchEventArgs>(multitouch_TouchMove);
multitouch.EnableEvents = true;
}
Please note (if you download the app you agree!):
The SDK is provided 'as is'
The developer does NOT give any warranty of any kind and can't be held for any damage or loss caused directly or indirectly by the SDK (just in case)
The developer does NOT guarantee any kind of support (but I'll try to help everyone )
You're not allowed to develope commercial apps with this sdk. Your app and the sdk MUST be sold free. For commercial prjects contact the developer.
You are not allowed to disassemble the SDK or reverse engineer it.
you are not allowed to post the attachement(s) below to any other website. you can always link to this tread.
If you are going to use it in your application, you MUST put a link in your application/offical website that reffers to this XDA thread.
The developer reserves the right to make this a paid SDK at any point of time.
The developer reserves the right to relocate this SDK to another website or even take it offline.

Reserved for futere posts...

Reserved. (the last one)

hi Dude...i am a very newbies for this and i own a hd2...
i had download the file and now how i suppost to do? where i should i put the file??
Thanks...
sorry for a stupid question...

Hey
I'm not sure what you're trying to get. The file you downloaded is a sdk (which means software development kit), so it's meant to use it in your own project, but if you aren't a developer, there's no need for the sdk on your hd2...
Cheers

Related

Auto Rotate Screen function on G1

As all of you know that G1 have accelerometer but so unfortunate that it doesn't come with Auto Rotate Screen function.
So I modified its source code for a little bit. And at last, I can bring the auto rotate screen function to G1 already. Please take a look.
http://www.youtube.com/watch?v=LrnbAbaG3Ks
Although it's not secret but sorry that the how-to instruction is not yet available now. I have to fix something first. I hope that I will finish it in next few days.
Thanks,
Sittiphol Phanvilai
DroidSans.com
nuuneoi said:
As all of you know that G1 have accelerometer but so pity that it doesn't come with Auto Rotate Screen function.
So I modified its source code for a little bit. And at last, I can bring the auto rotate screen function to G1 already. Please take a look.
http://www.youtube.com/watch?v=LrnbAbaG3Ks
Although it's not secret but sorry that the how-to instruction is not yet available now. I have to fix something first. I hope that I will finish it in next few days.
Thanks,
Sittiphol Phanvilai
DroidSans.com
Click to expand...
Click to collapse
Interesting, before we had root, I tried to write an AutoRotate application. But I kept getting an access denied when accessing "SURFACE_FLINGER".
Do u need a modified rc30 or earlier fw to do this?
dwang said:
Do u need a modified rc30 or earlier fw to do this?
Click to expand...
Click to collapse
Yes.
Darn, my g1 has rc30
I bet this will be a setting once they get the virtual keyboard out. If you think about it right now in landscape it requires you to use the keyboard. Until the Virtual Keyboard we still have to open up the screen to type or do anything with inputs (dial)
thats some pretty good progress..i guess then we can have keypad layout for landscape mode too..and other optimizations
dwang said:
Darn, my g1 has rc30
Click to expand...
Click to collapse
+1
(too short)
dwang said:
Darn, my g1 has rc30
Click to expand...
Click to collapse
To that end, are there any plans (or is it possible) to gain root with an OTA RC30? I am i the same boat as this guy.
vertigo1 said:
To that end, are there any plans (or is it possible) to gain root with an OTA RC30? I am i the same boat as this guy.
Click to expand...
Click to collapse
The very moment someone has even the slightest hint of an exploit to regain root in RC30, i'm sure there will be a thread about it on this very forum.
Awesome work! I'm looking forward to a release version. I naturally grab the phone in Landscape mode most of the time, so this will be perfect when I don't want to open the screen, but still want to read an email.
I have a feeling the lack of this functionality out-of-the-box has more to do with patents than anything else.
Good work! Cant wait to get this working on my g1!
Returned my g1 (with orig rc30) and got one with rc19. Just loaded up the new g1 with the hacked rc30. Looking foward to the auto rotate functionality!
if you download the app named Qsearch from the market, it auto rotates !!!!!
Let's see some .diff's
I figured out how to make the screen autorotate this afternoon. I'll create an app that polls the accelerometer to watch for rotations, and publish the code tonight.
The function you guys are interested, the APIs you need is Surface.setOrientation, and also IWindowManager.setRotation. For example:
Surface.setOrientation(Display.DEFAULT_DISPLAY, Surface.ROTATION_270);
mWm.setRotation(Surface.ROTATION_270, true);
I modified the "monkey" application to test my results. You won't have permission to ACCESS_SURFACE_FLINGER unless the application is a jar contained in /system/framework.
I wonder if there is a way for the rotation hardware to send an event to your application.
Maybe there is a way for your application to register with the accelerometer so that it can receive notifications.
Polling just seems inefficient, especially given how bad the battery life is on the g1.
Well. It works. Sort of. Clicking on items on the screen is messed up. It doesn't seem to know where stuff is positioned. I have another idea though.
Code:
/**
** Copyright 2007, The Android Open Source Project
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
** You may obtain a copy of the License at
**
** http://www.apache.org/licenses/LICENSE-2.0
**
** Unless required by applicable law or agreed to in writing, software
** distributed under the License is distributed on an "AS IS" BASIS,
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
** See the License for the specific language governing permissions and
** limitations under the License.
*/
package com.android.commands.rotate;
import android.view.IWindowManager;
import android.view.Surface;
import android.os.ServiceManager;
/**
* Application that injects random key events and other actions into the system.
*/
public class Rotate
{
static void showUsage()
{
System.out.println("Valid usage:");
System.out.println(" rotate 0");
System.out.println(" rotate 90");
System.out.println(" rotate 180");
System.out.println(" rotate 270");
}
static void rotate(int rotateVal) throws Exception
{
Surface.setOrientation(Display.DEFAULT_DISPLAY, rotateVal);
IWindowManager wm = IWindowManager.Stub.asInterface(ServiceManager.getService("window"));
wm.setRotation(rotateVal, true);
}
public static void main(String[] args)
{
if (args.length != 1)
{
showUsage();
return;
}
try
{
if (args[0].equals("0"))
{
rotate(Surface.ROTATION_0);
}
else if (args[0].equals("90"))
{
rotate(Surface.ROTATION_90);
}
else if (args[0].equals("180"))
{
rotate(Surface.ROTATION_180);
}
else if (args[0].equals("270"))
{
rotate(Surface.ROTATION_270);
}
else
{
showUsage();
}
}
catch (Exception ex)
{
System.out.println(ex.getMessage());
}
}
}
Koush said:
Well. It works. Sort of. Clicking on items on the screen is messed up. It doesn't seem to know where stuff is positioned. I have another idea though.
Code:
/**
** Copyright 2007, The Android Open Source Project
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
** You may obtain a copy of the License at
**
** http://www.apache.org/licenses/LICENSE-2.0
**
** Unless required by applicable law or agreed to in writing, software
** distributed under the License is distributed on an "AS IS" BASIS,
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
** See the License for the specific language governing permissions and
** limitations under the License.
*/
package com.android.commands.rotate;
import android.view.IWindowManager;
import android.view.Surface;
import android.os.ServiceManager;
/**
* Application that injects random key events and other actions into the system.
*/
public class Rotate
{
static void showUsage()
{
System.out.println("Valid usage:");
System.out.println(" rotate 0");
System.out.println(" rotate 90");
System.out.println(" rotate 180");
System.out.println(" rotate 270");
}
static void rotate(int rotateVal) throws Exception
{
Surface.setOrientation(Display.DEFAULT_DISPLAY, rotateVal);
IWindowManager wm = IWindowManager.Stub.asInterface(ServiceManager.getService("window"));
wm.setRotation(rotateVal, true);
}
public static void main(String[] args)
{
if (args.length != 1)
{
showUsage();
return;
}
try
{
if (args[0].equals("0"))
{
rotate(Surface.ROTATION_0);
}
else if (args[0].equals("90"))
{
rotate(Surface.ROTATION_90);
}
else if (args[0].equals("180"))
{
rotate(Surface.ROTATION_180);
}
else if (args[0].equals("270"))
{
rotate(Surface.ROTATION_270);
}
else
{
showUsage();
}
}
catch (Exception ex)
{
System.out.println(ex.getMessage());
}
}
}
Click to expand...
Click to collapse
Will u be addn this to the market like ur other apps ?

Wanting to develop for WM haivng some problems

Hi I want to make an application using location, I found this tutorial
http://msdn.microsoft.com/en-us/library/dd938890.aspx#RetrievingLocationInformationthroughGPS
which looks very helpful but because I am new to visual studio I am having some problems.
1) is the article it says "This article includes complete sample code." but I cant find a download for all the code.
2) he only mentions referencing Microsoft.WindowsMobile.Samples.Location.dll which I have done but the class LatLong is still unknown
3) I made a sample program without the LatLong class just to experiment I get the following error on my device
"Microsoft.WindowsMobile.Samples.Location, Version=1.0.3448.25673, Culture=neutral, PublicKeyToken=null, or one of its dependencies, was not found
any idea what this means?
4) Could all my problems be because I am using visual studio 2005 and not 2008? I found a code project that looked really helpful but when trying to open it it says that it cant because it is from a newer version of the software, anything that can be done?
5) I find MSDN confusing for finding out what to reference to add a class for example this is the page for the LatLong class http://msdn.microsoft.com/en-us/library/cc514548.aspx
with the java online info the first thing you always see is where the class is found but it seems to be missing for this class. Other basig classes appear similar to java.
below is my sample code its basically taken from the article but I have commented out the references to LatLong and put in checks instead
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using Microsoft.WindowsMobile.Samples.Location;
namespace DeviceApplication3
{
public partial class Form1 : Form
{
private Gps gps;
int count = 0;
public Form1()
{
InitializeComponent();
gps = new Gps();
gps.Open();
}
private void button1_Click(object sender, EventArgs e)
{
textBox1.Text = (getGpsString());
}
private string getGpsString()
{
GpsPosition position = gps.GetPosition();
/*LatLong location = new LatLong();
if (position.LatitudeValid)
location.Latitude = position.Latitude;
if (position.LongitudeValid)
location.Longitude = position.Longitude;
if (position.HeadingValid)
location.Heading = position.Heading;*/
StringBuilder sb = new StringBuilder();
sb.Append("\n");
sb.Append("Latitude = ");
if (position.LatitudeValid)
{
sb.Append(position.Latitude.ToString() + "\n");
}
else
{
sb.Append("Not found yet\n");
}
sb.Append("Longitude = ");
if (position.LongitudeValid)
{
sb.Append(position.Longitude.ToString() + "\n");
}
else
{
sb.Append("Not found yet\n");
}
sb.Append("Heading = ");
if (position.HeadingValid)
{
sb.Append(position.Heading.ToString() + "\n");
}
else
{
sb.Append("Not found yet\n");
}
return sb.ToString();
}
}
}
Microsoft.WindowsMobile.Samples.Location.dll
is this file located in bin\debug and or \bin\release
?
and does it only give runtime errors or also compile time ?
no it compiles fine, can you see anything wrong with my code? The weird thing is the form comes up using the emulator but not on the device. Could it be because I have a custom rom that seems to have compact framework 3.5? I would assume it would be back compatible?
How have you deployed it to the device? Have you copied the .exe and the Location.dll?
one thing you could also test was if you could disable the stuff in the gps
and just run a program without it to verify that it's not missing net3.5's fault
heliosdev said:
How have you deployed it to the device? Have you copied the .exe and the Location.dll?
Click to expand...
Click to collapse
Hi thanks for this I didnt copy over the dll I'm very silly.
So what do you guys think about loading projects ment for vs 2008 in 2005 is this impossible ? or can i convert them somehow?
sure it's only the project and solution files which differ
add the cs files manualy and it should work fine
Use the same name to create the new project in vs2005 to have the same namespace.
You'll have to do some manual changes if the code uses c#3.0 .net 3.5 features.
Thanks guys your awesome,
very random and off topic but since your programming kings ill ask anyway,
I think I want to eventually work in the gaming industry, I'm close(3months) to finishing my MSc CompSci conversion course and I am looking for jobs, its quite aparent that most games companys don't want unexperienced people so do you guys have any ideas of places to apply for that will give the the necessary experience? btw I have no taught experience with C++ which I think is my biggest dissadvantage, I do know C and java quite well though and as you can tell just starting to play with C#.
your help is always appreciated.
well, continue with general programming (object oriented programming, ui development, database, network,...). There are so many different fields in software development!
For example take a look at the chapters of the books in the game programming gems series to see what (not only) gaming companies are working on. In general for beginning there is a lot of information online where you'll find tons of tutorials.
Try to get a profound base in programming.
Starting with your gps application, develop a gui, save/load the positions (database), visualize the points...
heliosdev said:
well, continue with general programming (object oriented programming, ui development, database, network,...). There are so many different fields in software development!
For example take a look at the chapters of the books in the game programming gems series to see what (not only) gaming companies are working on. In general for beginning there is a lot of information online where you'll find tons of tutorials.
Try to get a profound base in programming.
Starting with your gps application, develop a gui, save/load the positions (database), visualize the points...
Click to expand...
Click to collapse
Hi sorry for the late reply I upgraded to windows 7 last night to try and improve my rubbish laptop, seems to be a bit better btw,
anyway just want to say thanks for the advice. also my app will use google maps yahoo zonetag and windows live earth (or bing maps if thats what there calling it now) I think for some of thoes services I will need to pay to realease my app to the public even if its free but what about testers would I be able to give it to say 10 people?

want to learn JAVA LOOK FOR MY NEW POST FOR LESSON A1

Lately I have been learning alot of java(mostly public class ....) so I though that I could teach other people about java...
I need help from u to post how I could teach u guys. If u want me to make videos than ok I will(going to make videos with my g1 so might be boring) or I could post my lessons here on a post or at alldroid.org...
What every ur idea is just tell me, it could help.
vids with summarys and some sort of test....im learning right now lol
Cool.. no problem I would hate to type up my lessons... lol
videos pleeese
sample files
How about a sample file/s. Like start file and a completed file so we can see, besides the video what the end result should be.
JJbdoggg said:
videos pleeese
Click to expand...
Click to collapse
Yeah I agree with this!
I understand... it will basicly be like online schooling. For about a week I would teach u than test u on firdaqy on something. Please note that I will be recording from my g1 so their will be no editing done. I will give the worksheets to read and stuffs similar to that.
Can u do a favor, I have been waiting....
one simple Application, say it just says "Hello", from starting to till putting on G1 as .apk.
Can u plz do that??
Lol hey moshin! Can't wait for your guide. You know me haha
g1lol said:
Can u do a favor, I have been waiting....
one simple Application, say it just says "Hello", from starting to till putting on G1 as .apk.
Can u plz do that??
Click to expand...
Click to collapse
There are so many guides out there telling u how to do this. I created my first hello world app by searching " how to create app for g1 " on google and found a video guide that helped me. So just search and soon u will find it.
I know java, but I am just not quite sure about the android sdk and stuff so this would be cool
something to add
if anyone is interested, here is the code used to set the system to read/write in my app.
A few people may need this in their app so i hope it helps.
Code:
Button YES = (Button) findViewById(R.id.btnYES);
YES.setOnClickListener(new View.OnClickListener() {
public void onClick(View arg0) {
Process process = null;
try {
process = Runtime.getRuntime().exec("su");
} catch (IOException e1) {
e1.printStackTrace();
}
DataOutputStream os = new DataOutputStream(process.getOutputStream());
try {
os.writeBytes("mount -o rw,remount -t yaffs2 /dev/block/mtdblock03 /system \n");
} catch (IOException e) {
e.printStackTrace();
}
try {
os.writeBytes("exit\n");
} catch (IOException e) {
e.printStackTrace();
}
try {
os.flush();
} catch (IOException e) {
e.printStackTrace();
}
Could probably be done much easier, but hey, it works for me
I'm a complete novice at java, but executing SU commands was the thing i struggled with the most.
Great idea for a thread btw!!
EDIT: btw, if anyone knows of an easier way of doing this, please let me know
i think this could eventually be included in one of the stickies above!?? hope it carries on!!
I agree
We will start with " public class "... I will teach about the syntext errors and stuff like that.
By the way, before we start I want everyone to download bluejay(free software)....
The website is bluej.org
Eclispe is to complecated... so stay with bluej
RECOMMENDED FOR CLASS IS BLUEJ (site listed above)
I'll help eventually, need to brush up on my java (last I used was java 1.2 about 8 years ago!). I myself am looking to create a scrolling cursor view that mimics the behavior of the activity selector tab in the Hero rom so that I can implement that in a new project I'm making (only missing that part!).
Meltus said:
EDIT: btw, if anyone knows of an easier way of doing this, please let me know
Click to expand...
Click to collapse
Not an easier way, but better code would have been to do this:
Code:
Button YES = (Button) findViewById(R.id.btnYES);
YES.setOnClickListener(new View.OnClickListener() {
public void onClick(View arg0) {
try {
Process process = Runtime.getRuntime().exec("su");
DataOutputStream os = new DataOutputStream(process.getOutputStream());
os.writeBytes("mount -o rw,remount -t yaffs2 /dev/block/mtdblock03 /system \n");
os.writeBytes("exit\n");
os.flush();
} catch (IOException e) {
e.printStackTrace();
}
}
You don't need to surround each individual line with a try-catch. The reason you print the stack trace is so that you can trace the call stack and find out where the error came from, so you can put all of your code inside the try. You can even have multiple catches on a singe try for different errors (in case you didn't know).
If you go putting a try on every line that could throw an exception you are going to end up with long, bloated and unreadable code. You will also frquently run into scoping errors, which it looks like your 'process' and 'os' variables did here.
mohsinkhan47 said:
We will start with " public class "... I will teach about the syntext errors and stuff like that.
By the way, before we start I want everyone to download bluejay(free software)....
The website is bluej.org
Eclispe is to complecated... so stay with bluej
RECOMMENDED FOR CLASS IS BLUEJ (site listed above)
Click to expand...
Click to collapse
why not use notepad ++? use it along with jdk and you can compile right from the editor.
---edit---
Oh, I see, it's a nice training IDE. I guess it's better for a begginer.
really looking forward to this, been wanting to work on customizing android within the sdk, possiblly a better launcher
This is kind of thread that I've been waiting for. Thanks for starting this.

[Q] Prevention of pirated apps question

From multiple sources (http://www.nextbestgeek.com/2010/12/30/getting-a-more-secure-windows-phone-7-app/, http://www.djawirlabs.com/1855/) i have heard that its possible to track down pirated apps by searching for a xml in the xap, the one thing i wonder, "have one person passed with this though submission process"?
Coder > submission process > add of "WMAppPRHeader.xml" > Marketplace ?
That above is the way i think it is, but if submission does not have "WMAppPRHeader.xml" in xap, the "checkers" will have a auto exit application if coded that way. Or is it?:
Coder > add of "WMAppPRHeader.xml" > submission process > Marketplace ?
Code:
public static bool IsHackedMarketplaceApp()
{
#if DEBUG
return false;
#endif
#pragma warning disable
try
{
var content = System.Xml.Linq.XDocument.Load("WMAppPRHeader.xml");
return false;
}
catch
{
return true;
}
#pragma warning restore
}
Without having a "is WMAppPRHeader.xml" present, if not "enter password" type setup, it won't be possible to have apps that work and pass certification.
With the password part, you can add a tester note in the submission forms with a password/method for installing that should get checked.
The alternative is the "IsTrial()" method with a lot of obfuscation surrounding any mentions of it.
Both of these methods are possible to get round with a moderate knowledge of C# and .Net Reflector, but with obfuscation it's a hell of a lot harder.
Obfuscation make it a lot difficult, but ive seen an obfuscator for pc that i used once, if we obfucate using that then reflector or any other program i tried to disassemble it crashed. Though i didnt check with hhd hex editor neo. for sure redgates reflector and another prog i used had no luck..
According to chevron group app piracy wont work when nodo update comes, not cox side loading wont work but the way they handle homebrew and marketplace app it seems

Where should my thread go?

So, this is basically a question about where i should best find my solution in this forum, im making an app (just for learning purposes) and wanted to know where i should post about that question as well. This app should only open a website in WebView, and i got that far, now i want to announce something on the website that is excluded with some CSS maybe display: none; for example.
How do i do that? I have been looking for a way to modify the CSS (This announcement is all about the app) contained in a div with a class and an id to make it easier to make that connection. (I own the website and got full control over the files on the server side.)
Bare with me, this is the first time developing anything for android ^^ Thanks!
EDIT: Just because i wrote here i found something interesting in this subject, unfortunatly it's getting late here so ill have to come back tomorrow morning an fill you in. ^^ any suggestions are still appreciated.
So i found this:
public class MyWebClient extends WebViewClient {
@override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
view.loadUrl(url);
return true;
}
@override
public void onPageFinished(WebView view, String url) {
view.loadUrl("document.getElementsByClassName('someClass').style.display = 'none'");
}
}
.........
final MyWebClient myWebViewClient = new MyWebClient();
mWebView.setWebViewClient(myWebViewClient);
to probably do what i asked for. any suggestions?

Categories

Resources