WM Programming-Pascal and C console programs - General Questions and Answers

Hi everyone!
I'm studying Turbo Pascal and C programming languages at school,I write console programs from "add 2 numbers and print the result" to something more complex.
I was wondering...is there any way to get these simple console programs to work on my HTC Touch PRO 2 (WM 6.1)?
Hope you can help me...
Thanks!

I 2nd this, I'd like to know too.
Or otherwise I'm also interested in writing a basic app for WM just to try it.
Jason

easy to do with c using embedded visual c++ which you can google and it's free and c++ is always backward compatible with ansi c
doubt you will have much luck with pascal because the best bet would have been borlans options and they quit the whole market with their delphi pascal options
nailing the last nail in the coffin of pascal

For Pascal, use FreePascal/Lazarus combo. It's a ***** to set up, though.

Rudegar said:
easy to do with c using embedded visual c++ which you can google and it's free and c++ is always backward compatible with ansi c
doubt you will have much luck with pascal because the best bet would have been borlans options and they quit the whole market with their delphi pascal options
nailing the last nail in the coffin of pascal
Click to expand...
Click to collapse
Can I write console applications with it,or they have to have a GUI?
Chainfire said:
For Pascal, use FreePascal/Lazarus combo. It's a ***** to set up, though.
Click to expand...
Click to collapse
Yeah,i tried that,but i can't make it work...I followed the guide but i can't do anything that works on WM

"Can I write console applications with it,or they have to have a GUI?"
both a lot easier to make console apps though

Thank you,I'll give it a try

The problem you will encounter with console applications is the fact that there is no console as such.
printf() will not work as there is no output window on which to write anything. There is also no way of reading user input direct from the 'keyboard' or keypad.
When the exe is run it starts as a windowless application, the WinMain() function is called and when this ends it is terminated. You can open and close files, read and write to and from them, anything you like, as long as it requires no user input, and does not display anything. Pretty restrictive! The only thing the user will see is the hourglass/busy icon, until the app finishes.
Even C# console applications are subject to the same restrictions.
To do anything 'smart' it will have to be a PPC (GUI) application.

there are plenty of free console apps one can download for free

stephj said:
The problem you will encounter with console applications is the fact that there is no console as such.
printf() will not work as there is no output window on which to write anything. There is also no way of reading user input direct from the 'keyboard' or keypad.
When the exe is run it starts as a windowless application, the WinMain() function is called and when this ends it is terminated. You can open and close files, read and write to and from them, anything you like, as long as it requires no user input, and does not display anything. Pretty restrictive! The only thing the user will see is the hourglass/busy icon, until the app finishes.
Even C# console applications are subject to the same restrictions.
To do anything 'smart' it will have to be a PPC (GUI) application.
Click to expand...
Click to collapse
What if I use Pocket Console,or something like that? Would they run correctly?

Can't really say, as I haven't used them. The console stuff I have written, drags objects from over the net, then writes the data out in a format I can use to a file on the device. No user input required.
All I can suggest is to try the classic
printf("Hello World!\n")
and see what happens. Good Luck!

C programing
Hello,
yes, you can. Just use pocketdos. An emulator for DOS and you can use your simple compilers
Search for Pocketdos.com

xdawis said:
Hello,
yes, you can. Just use pocketdos. An emulator for DOS and you can use your simple compilers
Search for Pocketdos.com
Click to expand...
Click to collapse
Thank you! They work now! PocketDos is great!

Related

Diagnostic Tool

Has anyone produced a diagnostic tool yet that allows me to interrogate my phone from my laptop to get a memory table of all apps (not user data texts contacts etc) running on the phone to clean up unused apps without having to go into tthe phone menu all the time. If there is a cost for the app, please let me know.
Thank you
SIMBian
What do you mean, to do remote task killing etc?
Check out the Visual Studio remote tools. They are available free in the earlier versions.
V
vijay555 said:
What do you mean, to do remote task killing etc?
Check out the Visual Studio remote tools. They are available free in the earlier versions.
V
Click to expand...
Click to collapse
Yes I have four devices and two were mine and two given to me for work. Two given to me are fully of apps that I do not want but I want to find out about them before I delete. I know its lazy, but to be able to have
to delete these apps from a single list on my laptop rather than having to do delete each time in the device. Also I can manage my devices better so I can use one for SIM/USIM development work and the business and keep my Wife's and my personal one seperate from business.
Thanks I will google now to find the program.
Many thanks vijay555. If there any SIM/USIM questions I can answer for you just ask.
SIMBian
Actually I might be able to save you some googling:
Just go to www.microsoft.com/downloads and search there.
Unfortunately if I remember correctly, you cannot install remote tools without the studio it self (maybe I am wrong).
Also if you are already working with some IDE for windows mobile like eVC check out 'Remote process viewer' in the tools menu.
Also look for a user called itsme on this form. He created a remote task manager (don't remember if it's just to show tasks or kill them as well).
Check the WiKi for itsmeutils or something like that.
levenum said:
Actually I might be able to save you some googling:
Just go to www.microsoft.com/downloads and search there.
Unfortunately if I remember correctly, you cannot install remote tools without the studio it self (maybe I am wrong).
Also if you are already working with some IDE for windows mobile like eVC check out 'Remote process viewer' in the tools menu.
Also look for a user called itsme on this form. He created a remote task manager (don't remember if it's just to show tasks or kill them as well).
Check the WiKi for itsmeutils or something like that.
Click to expand...
Click to collapse
Thanks "levenum" I have taken a note of what you have said and hope I can return the same help to you sometime.
It could be when I've done the research and got the tools that I may have to develop an app. Perhaps I can post here (like I have seen others do) and see if you would be willing to beta test a work in progress.
When complete would be happy to share the final work with the forum.
Thanks again
SIMBian

how to reboot from a WM user interface?

Hello the community
I would like to know how to perform a soft reset (reboot) from a WM user interface. Of course there is a lot of external programs and utilities providing such the functionality also, but I guess there should be a mechanism built in WM.
I am sure there should be a DLL responsible for that, so probably there is also a way to execute this DLL?! Something like Windows’ rundll.exe?
My device is HTC p3600/Trinity with WM5, but I think it doesn’t make sense.
Your advice would be much appreciated,
Br, Alexey
dll mean dynamic linked libary
which pretty much mean it's a lib full of functions that
other apps call you cant normaly just call it's functions from
the GUI
yes, I know what DLL actually mean
And that’s why I made a guess about a possible way to run DLL similar to rundll.exe
I would prefer using something like reboot.exe, but if such a program isn’t provided along with standard WM, I don’t mind using workarounds like running DLL, if possible.
Anyway, my question was not about real nature of DLL but the way how to perform a reboot using standard functions of WM.
Check out the SDK documentation, MS might have made a direct api to achieve this through a direct rundll type action, but the easiest way is just to code a tiny app and launch it, eg
http://www.pocketpcdn.com/qa/softreset.html
VJEschaton will reset in a variety of fashions.
V
Thanks
Is there a way to compile such a tiny application without installing any huge C++ IDE? Something like command line compiler downloadable thru a simple ZIP file?
shkaff said:
Thanks
Is there a way to compile such a tiny application without installing any huge C++ IDE? Something like command line compiler downloadable thru a simple ZIP file?
Click to expand...
Click to collapse
The C# compiler is free and can produce WM executables. The only problem is that you must instruct it to use the .NET Compact Framework libraries instead of the normal ones. I readied a guide when the last OS was WM2003. I don't know if it is still working, but actually I have no reason to think it won't. Just choose the right subset of files.
Here is the link:
http://www.jargoncode.it/tips/netcfcompile-eng.htm
If you want a C++ compiler... I don't know.

C++ GUI

Does somebody know where i can find any tutorials on GUI handling in c++ for windows mobile 6.1
My code is complete but i still have to code the interface, but i can't find anything on how to do this.
(made in vs 2008, c++ smart device application with SDK 6 pro)
Hy,
you can try mfc.
Greatz
mccoffein
yeah miniMFC is the other other wiciwigy interface for wm apart from .net
and it's slower then pure win32 where you have to build all guild in code by hand
but it's faster then .net
but why use mfc if its slower, i just need 1 input box 1 output box like a multi line textbox and a start button.
Just need 1 tutorial on how to do it, i messed around with the resources where i made a dialog but i can't do anything in the main window.
MFC is easier, as it provides classes for handling all this stuff, and it also wraps up the windows messages into convenient events to deal with.
If you want to do it the hard way, you will have to master the function CreateWindow() or CreateWindowEx()
Search for it in VS Help and make sure you select the CE version.
Buttons, textboxes, checkboxes, etc., are all child Windows, connected to/owned by, the main window of the application.
Search for 'Control Styles' to find what parameters to pass to to it, in order to create what you want.
Search VS help using 'Creating a Button' for some examples, and study them hard.
You will have to get to grips with all this before you can even start.
Aah well I have done my fair share of assembly guess i am lucky there.
I never knew that every item on a form was considered a window, however it does make sense if your looking around with spy++
I'll just check how fast it runs on MFC, because now it already takes 5 minutes to run in the worst case scenario (this however is inside the emulator).
Thanks for the information guys

running application in C on mobile phone with Android

Hello !
SUMMARY: How to run pocketsphinx_continuous on mobile phone with Android, and how to do it with simulator of mobile phone with Android. PocketSphinx can be downloaded for free here, for both Linux and Windows: http://cmusphinx.sourceforge.net/html/download.php .
Click to expand...
Click to collapse
------------------------------------------------------------------------------------------------------------
SHORT EXPLANATION
I'd like to create application for mobile phone and server such that:
1. User runs application on mobile phone with Android, this application uses PocketSphinx. It is Automatic Speech Recognition software for devices like mobile phones, written in C. Somebody told me that "Pocketsphinx is used successfully on Symbian with minimal effort". (However I think Android may be better choice). My knowledge about Android is limited but I know something about CMU Sphinx. Can you help me, please, to run this PocketSphinx on Android? I also need to find simulator of mobile phone with Android. I have already found Wireless Toolkit and I tried to use this emulator, however I think it doesn't allow to run simulation of mobile phones with Android. (By the way I am limited in my project to mobile phone of the price up to about 160 euro; which Android version would be best for my application?).
2. This application communicates with the user. The users speaks digits and some other words (dictionary is about fifteen words, I can create language and acoustic models, as well as formal grammar in CMU Sphinx, with the use of SphinxTrain). The application recognizes those digits.
3. Based on this talk, mobile phone sends information about results of recognition to the server. I can do it in Java for CLDC/MIDP with httpconnection, POST method on the mobile phone side and with Tomcat on server. I think this httpconnection must be possible not only in Java ME, but also in Android C. But this is thing which will bother me later, now I'd like to run pocketsphinx_continuous on Android and try to modify it according to my needs.
Summing up, what I'd like to know is how to run demo pocketsphinx_continuous on mobile phone with Android, and how to do it with simulator of mobile phone with Android. (I've got Wireless Toolkit but I think it is not capable of running Android). PocketSphinx can be downloaded for free here, for both Linux and Windows: http://cmusphinx.sourceforge.net/html/download.php . There are two ways of installing it in Ubuntu. First is to unpack it (it is tar.gz), enter its directory and type "./configure", "make", "sudo make install". The other, different, is written in README file, i.e. run autogen.sh, "./configure", "make clean all", "make test", "make install". The result should be, among many other files, javadoc in doc directory.
------------------------------------------------------------------------------------------------------------
LONG EXPLANATION
What is required to give me some advices is written above. So if you don't want / don't have time to read the whole text, just above explanation is enough. But let me say about other possible approaches which I try to do. Those are worse than what I explained above, but I also tried them.
CMU Sphinx contains SphinxTrain to create acoustic model. It has got some different recognizers (also called decoders), those are PocketSphinx, Sphinx4 and some other. PocketSphinx is written in C and is for devices like mobile phones. Sphinx4 is Java application for PCs because it requires better hardware. There is good tutorial about using SphinxTrain with Sphinx4. It is here: http://www.speech.cs.cmu.edu/sphinx/tutorial.html . There is no similar tutorial for PocketSphinx. However with some knowledge about Android and C it is possible to run it on Android. The other approach than PocketSphinx, is using this Sphinx4. However it requires connection between mobile phone and server, sending audio data from cellular phone to server. It can be done with Skype, but there is still problem on server side with redirecting sound from Skype to Sphinx4. So you see there are two different approaches. One is to run speech recognition on mobile phone with PocketSphinx and Android. The other is speech recognition on server with Sphinx4. There are some ways to follow this second option. One is Skype on both server and mobile phone. (But there is problem with redirecting speech from Skype to Sphinx4). The other is too expensive Digium card. The third one is IVR, but I still look for good open-source IVR software. All of those three ways of second option involve Sphinx4. It was much easier to create application with Sphinx4. It is for PCs, not embedded devices, because it requires better device, extensive floating point math and some other things. But it has much better documentation than PocketSphinx. But I want to use PocketSphinx because I don't need to pay to anybody for access to mobile internet in order to send data through internet for application like Skype. The access to internet is required only for short time to send little text data with httpconnection, POST method. This is why I'd like you to help me, please, with running pocketsphinx_continuous on simulator of PocketSphinx on mobile phone with Android. (By the way, I see I've got installed S60 Developer Tools -> 3rd Edition FP1 SDK -> MIDP -> Emulator).
Summing up in a list, those are in CMU Sphinx:
I. SphinxTrain, which I can use to create files needed for speech recognition
II. decoders which use speech input and some files which I create with SphinxTrain, to follow speech recognition (input speech + files from SphinxTrain = are used by decoder)
II-1. PocketSphinx, written in C, for devices like mobile phones
II-2. Sphinx3, written in C, for PCs, actually the best developed
II-3. Sphinx4, written in Java, for PCs, with the best documentation
II-4. Some other, older versions
Those are possible approaches of solving my task:
I. Speech recognition on mobile phone with PocketSphinx. This is much better way than [II].
Problems: 1. running PocketSphinx on mobile phone with Android. 2. simulating mobile phone with Android on PC. I also thought that maybe I should consider Meamo, what do you think about it? Or use things different than CMU Sphinx, e.g. Simon, HTK, Julius. I looked at those other ASR engines and I think PocketSphinx may be best choice.
II. Speech recognition on server with Sphinx4. There are some different ways of establishing voice connection between mobile phone and server.
II-1. ordinary call from mobile phone to server; server has got Digium card. Disadvantage: Digium card is expensive.
II-2. to use Skype on both mobile phone and server. Problem: redirecting of sound from Skype to Sphinx4 and vice versa.
II-3. can you think about any other ways? I found that Asterisk may be useful.
Greetings !
Summing up, what I'd like to know is how to run demo pocketsphinx_continuous on mobile phone with Android
Click to expand...
Click to collapse
First step would be to setup a toolchain and compile the prog for android
or statically linked with uClibc.
Then push it onto your device and test if it works as expected.
You can also push it onto the android emulator that comes with the sdk.
Just my 2 cents...
Thank you very much!
Can you give me any links to tutorials which can be useful for me?
By the way I know how to create my own application in Sphinx4 and I know how to run demo in PocketSphinx, but I've got some difficulties with creating my own application for PocketSphinx. So if you can have a look at PocketSphinx http://cmusphinx.sourceforge.net/html/download.php and tell me which files I need to have to create new project for PocketSphinx, I would be greatful. I mean that for Sphinx4 the only what I need to do is to enter S:\tutorial\sphinx4-1.0beta3-src\src\apps\edu\cmu\sphinx\demo\helloworld and create my own ...\demo\my_application, and inside it analogically to what is here ...\demo\helloworld. In the case of PocketSphinx, to run the application, I need to enter S:\tutorial\pocketsphinx\doc and run pocketsphinx_continuous. So I check what I've got in this file and I cannot see what files and where I need to have in order to create new project. I uploaded directory doc with pocketsphinx_continuous here: http://www.speedyshare.com/files/19429494/doc.7z
Greetings and thanks once more !
Rough outline: You'll need the Android SDK and NDK, both of which are available from http://developer.android.com/. The NDK will allow you to compile C code. You'll need to wrap the C core in a Java layer to make it accessible to the rest of the Android system. The SDK also includes an emulator, which I believe you've asked for if I understand you right.
I haven't actually attempted this, so that's about all the help I can be, but there is sample code included with the NDK that should get you started.
Thanks for your answer !
I check the google and see that NDK is term of Android, because I knew only SDK abbreviation. I assume NDK is especially for porting (like porting PocketSphinx for Android). So am I right that with this NDK I don't need to change code of PocketSphinx? I think it would be too easy .
There also other question which I've got. It is not strictly connected with Symbian but there wouldn't be any need for porting if I won't solve this problem. I've got my application in Sphinx4. There are also examplary appications for Sphinx4 and PocketSphinx. I can run demos from PocketSphinx (as explained in first post), as well as demos from Sphinx4. I can change source code of demos from Sphinx4 to perform my task. I'd like to do similar thing with PocketSphinx, but even if it should be easy task, I cannot do it. In Sphinx4 it is much simpler because all source files are in one directory. In PocketSphinx it is done in somehow different way. (http://cmusphinx.sourceforge.net/html/download.php). Without ability to move my application from Sphinx4 there is no need for me to port this PocketSphinx to Symbian.
Greetings !
johnyjj2 said:
I assume NDK is especially for porting (like porting PocketSphinx for Android). So am I right that with this NDK I don't need to change code of PocketSphinx? I think it would be too easy .
Click to expand...
Click to collapse
NDK is used to write software for Android devices that are compiled natively to the platform -- for now, this usually means ARM. Java as you probably realize is a bytecode intermediate language that the java virtual machine converts to native calls at runtime. This means that Java is generally platform independent whereas your C code is not.
JNI as used with the NDK is the Java Native Interface (or something to that effect). It allows you to call code that has been compiled for a specific processor from Java. This means that you could put heavily optimized super fast calculations in a native library and call them from your Java app.
It could also mean, that you've more or less written your entire application in some native code, and then you have written a java shim that has enough code to initiate and start your native software. Beware, there be dragons here.
The fact that you CAN do this, doesn't mean you SHOULD. There are a lot of benefits to using the android platform and specifically using the android way of writing applications. Concepts like views, activities, intents, etc., greatly simplify how an Android device interacts with other Android devices and provides a consistent and powerful framework.
For something like SCUMMVM, it is a game (platform) that is very linear in design; you are either actively playing it, or it is on pause. How other applications are running while using SCUMMVM is inconsequential. It sounds like you have very different requirements.
Thanks for answer!
Isn't that link (http://cmusphinx.svn.sourceforge.net/viewvc/cmusphinx?view=rev&revision=9470) simply trying to copy engine library to Symbian, without effect? Only enginge won't help, there is also need to write from zero code which will use this library. So it looks like there is still long way to have it working. Do I understand it properly?
Greetings!

[Q] SDK for coding on Androi

Hi,
I'm looking for an Android-app that would allow me to write little programs (and run!) directly on the phone.
I don't need any fancy tool to create high quality grafics or anything. I just need a simple editor (if possible with syntax coloring like "touchqode") that I can use to write, compile and run little programms (shell output would be enough).
I don't really care which programming language (java, c/c++/c#, pyhton, basic, pascal....) as long as it's not brainfuck ;-)
Would be nice if it was for free, but I'd also pay for it if it doesn't cost too much.
Anyone got any suggestions?
Thanks
Kai
Google has their own development environment for beginners and simple programs.
Google App Inventor
If you're more hardcore, install the Google Android SDK and Eclipse.
Thanks for your reply Sentinel196,
But unfortunatly that's not what I'm looking for (since I don't want to write my own programming environment ;-)).
I'm looking for something like "eclipse for android" or a python/ruby interpreter that I can use directly on my phone (coding, compiling/interpreting, run).
Maybe someona has an idea.
You could try Ruboto
its an Ruby implementation for Android
its also available in the market, but tbh i never tested it
or you could look if jruby & android works together
well gl im also interested in using ruby to programm for android
//edit
i installed ruboto over the market, might be rly something for you
you can write ruby scripts and execute them via the ruboto app
some examples for opengl/acitivites/dialogs are also integrated
Thanks alot! Does exactly what i need! Even can play with buttons and its free...
Sent from my GT-I9000 using XDA App

Categories

Resources