[?] How to keep console application running in background ? - HD2 Windows Mobile 6.5 Themes and Apps

Hey guys,
Im in mid developing here and was wondering if i could make my application run as a service instead. So i started working on a side project which is a testing application, and from what i undrestood in windows mobile world, console applications are services.
So i wrote the code and tried it but it just keeps ending when finishing the lines of code, even if i have started eventhandlers... How can i change this behaviour in order to keep the application in the background listening to the events while still being a service and not a basic application?

Related

Developing a Portal application in C#

I am wanting to develop a portal application in C# for Windows Mobile 6.0. I have installed the .net Compact Framework 3.5 on my device and have the necessary tools on the PC to develop for Windows Mobile. I am using Visual Studio 2005 to develop this application.
I am not a programmer, I have little experience with .net technologies but have for past assignments used VB.net to create small applications for assignments at uni.
I am now in my third and final year at uni and I decided to take on a project that is titled Human Computer Interaction of Mobile Devices. As part of my project I am required to produce an application, though designing various menu systems in itself will be quite a job, not to mention the documentation of it all.
The application I want to create now, is not necessarily part of my project, though it may influence me later on and should go some way to helping me. I have had the intentions of creating an application in Flash up to now.
Anyway, this application, its what I would call a portal. It has 4 tabs, Websites, Television, Radio and Programs. The Programs tab page has been designed much like the iPhone interface with either same or somewhat similar buttons. These buttons do not do anything at the moment.
I started the other week in designing an application in vb.net and run the debug exe as standalone on PC and linking to application that are on the PC will actually run when clicking on the picturebox as that is what I am using rather than buttons.
I put a Try Catch in and the error message comes up on the Mobile. If I take the Try Catch away then FileExceptionNotFound error message comes up and forces the program to close.
In C#, I have created much the same application, it does nothing whatsoever at the moment other than allowing me to flick from one tab to another. I am wanting to link pictureboxes in the programs tab to programs stored on the phone such as \Windows\Opera9.exe and \Windows\tmail.exe and so on.
I would like Radio Stations and Television channels to load up in a program specified in code if a default one does not start so I realise that I would need to call the link of the radio station (same with television channels) and then tell it to load up in specified program.
The other thing I am not sure about it how I would tell the phone to connect to the internet.
I didn't really want to be asking for help on here with this, as its probably not too difficult to create something like this, seeing as what some people (geniuses) on here have been able to develop. If nobody is able to help, then maybe pointing me in the right direction of some good reliable resources would be an idea. I have done much searching on Google etc for help with this and MSDN but my programming skills have never been up to much if I'm honest.
Any help would be much appreciated.
A few things then
For Visual Studio download and isntall the Windows Mobile SDK's (Version 6, standard and Pro).
Then when you create a new Mobile Device application you have everything you need. There should be a Toolbar in Visual Studio that allows you to select where your device will be run in Debug Mode (either the Emulator or on your device). This is the easiest way to debug your apps; also using MyMoblier will help.
Starting an App in C# is as easy as System.Diagnostics.Process.Start() method.
Connecting to the net is a little harder, I have written my own based on what I found using google. Basically it centers around 3 API calls:
Code:
[DllImport("CellCore.dll")]
static extern int ConnMgrEstablishConnectionSync(ConnMgrConnectionInfo connectionInfo, ref IntPtr connectionHandle, uint dwTimeout, ref ConnMgrStatus dwStatus);
[DllImport("CellCore.dll")]
static extern int ConnMgrMapURL(string url, ref Guid networkGuid, int passZero);
[DllImport("CellCore.dll")]
static extern int ConnMgrReleaseConnection(IntPtr connectionHandle, int cache);
Hope this helps
EDIT:
Also moved to Q&A to avoid upsetting them
Ta
Dave
Thanks for the advice. I have already downloaded Windows Mobile 6 SDK but I for some reason don't seem to be able to access the ROMS from WM6 inside of Visual Studio. I might be able work that issue out though. I will see how I get on with it and post back if I have any further problems.
Connecting to the internet.
I have found that the .net object WebRequest will open the connection if is not already open.
Stream ResponseStream = WebRequest.Create("yourURLgoesinhere").GetResponse().GetResponseStream() will return a stream to read to get the object.
If there is an active WiFi connection the phone will use it, or it will use an active GPRS connection, or fire up the default GPRS connection as a last resort.
The bottom line is - let the machine do all the hard work.

Can i make a WM C# program which runs a java program, or (help with google maps api)

Hello everyone I was wondering if anyone could answer this question for me.
I am creating a wm app and for part of it i want some information from googlemaps, the maps api is in java and i was thinking of ways to incorperate this into my app. Can i create a java program to get data from google and have my c# program run the java program and get info from it? I could write my program totally in java but i don't like the way i have to first start the vm and launch my program from that is there a way to automate this? also I need quite a lot of information from the phone so using c# will make getting this info easier.
or are there any other ways i might be able to get the info I want, I don't really know anything about applets but could they somehow be used?
oh btw the specific data i want is distance between to map locations (via googles route not direct)
many thanks i hope comeone can help

[Q] [DEV] Reference to XNA framework in Background Agent? /MediaPlayer/ Scrobbler./

Hey.
I'm currently working on an Audio Scrobbler for Last.fm.
I already ported the parts for scrobbeling and report now listening etc. form the C# Lib to Silverlight for Windows Phone.
So far it works very well.
But now comes the second big part:
receiving data from Zune Player in a Background Agent.
You can't use the MediaPlayer from XNA since you can't add a Reference to the Framework.
Now I'm flat on my back.. I got no idea how to receive the current song and information like duration, already played time, Artist and Track name.
Easiest would be a Work Arround to add a reference to the XNA Framework in an Background Agent.. Since it will not be posted to the official Marketplace it's not important what big M thinks about it.
Maybe one of you can help me out?
Off course the Scrobbler will be for Unlocked phones since only then you can run the Background Agent more often than every 30min.
So there is no problem in using RootTools or Interrop stuff.. but I have no idea of what I can do and since there is no complete documentation I don't find anything in the web.
App will be for free, so I can't give any reward but a Credit
Regards

[Q] running apps on device/emulator, resources needed

Hey I've recently rooted my first phone (didn't go as smooth as i'd like it to but the phone works) Anyway, I was thinking that i might learn to develop android apps. The thing is I have a few question which i wasn't able to find answers for or they didn't help me completely.
I downloaded ADT bundle from official android developers website (basically eclipse with the plugins preinstalled, am i right).
The first problem i encountered was that the emulator was so unbelievably slow,i know it's not only my issue and that emulator is slow in general, but I wasn't expecting this. My first app the incredible Hello World app which should take user input and (probably) print it out crashed when i tried to submit the text, though that probably wasn't the fault of emulator but rather problem with my settings (seriously i had to import a lot of stuff just do a simple hello world app) So, let's get to the first question itself. Is there a way to somehow run my app on my phone/tablet (nexus 7 II) in real time? Or besides emulator and copying the app on the device there's no other option?
My second question isn't that much android orientated, but here it goes: This year we are going to learn java at school and i was thinking if i could use ADT bundle from android developers as a regular eclipse if I choose java project instead of android project. Or is it better to use separate eclipse? if so, how do i set those IDEs so that they won't interfere with one and another. It it just a matter of setting different workspaces?
The third question is: Resources. What are some good resources for developing android Apps for beginners. I do have some programming knowledge but it's lather low, i do understand basic concepts, I did use java for really basic stuff but nothing serious. What books/video tutorials or any other resources would you recommend?

Android 11 popup on unattended device

Hello,
I have a huge problem that is making me leave android.
Since android 4 I have been developing software for devices that are stuck to a wall and spread-ed across the country, mainly price-checking and digital signage software.
The end user (the client from the retailer) cannot access menus and anything else other then what running software offers. With android 4 I was able to make updates to software remotely, and monitor control all the device, with vnc and ssh.
Recent android versions are picky and for example i cant have vnc , neither an ssh that allows me to control the system, unfortunately whit this i can live. but for example if i need to update my app with another apk which require more permissions it will show a popup asking for permissions, that is not OK on a remote device where no one from the company is using it. I cannot hope a client clicks yes on the popup for my app to run again.
Android 4 and 5 where perfect, android 10 and 11 are terrible for this. How can i bypass this, is it possible?
Thanks and sorry for the English.

Categories

Resources