Interest in a task automater / macro recorder and playback utility? - Windows Mobile Development and Hacking General

I wrote a program for Windows 2000/XP called Do It Again ( http://www.spacetornado.com/DoItAgain/ ) that does simple task automation (also called macro recording and playback).
You click "Create a New Task" and it then records all of your keystrokes and mouse clicks in any program until you hit a certain hot key (Scroll Lock by default). You can then run the task back in a number of different ways and it will recreate your keystrokes and mouse clicks... either with the same pauses in between, or it can speed them up. And there are some other options available as well (repeating tasks, manually extending pauses between actions, etc).
I thought something like this might be useful for Windows Mobile devices. I wrote Do It Again in C# using .NET Framework 2.0, so I'm guessing it should be fairly easy to port to .NET Compact Framework 2.0.
But I only want to start porting this to Windows Mobile if there is any interest in it, and if people think they might get some use out of it. I know for me personally there are several things I do on my WinMo device that get repetitive and monotonous... starting and minimizing GPS Test to activate the GPS adapter, dismissing old Notifications, marking all email as Read, etc.

This sounds like a perfect application which can be used for pretty much anything.
Personally, i'm very interested in this, and would be glad to have it ported.
There are a lot of people who're looking to do things the easy way around here, for instance, settings up accounts, changing settings.. and so forth, without having to go 8 clicks...

nir36 said:
This sounds like a perfect application which can be used for pretty much anything.
Personally, i'm very interested in this, and would be glad to have it ported.
There are a lot of people who're looking to do things the easy way around here, for instance, settings up accounts, changing settings.. and so forth, without having to go 8 clicks...
Click to expand...
Click to collapse
I would find this very useful for using both Google Maps and Tom Tom Nav.. Say you want to go somewhere new.. Use google maps to find the address and then activate the script, prime the GPS, load Tom Tom, then copy paste the address info into Tom Tom. One cycle activated by a hot key would be nice.

norkoastal said:
I would find this very useful for using both Google Maps and Tom Tom Nav.. Say you want to go somewhere new.. Use google maps to find the address and then activate the script, prime the GPS, load Tom Tom, then copy paste the address info into Tom Tom. One cycle activated by a hot key would be nice.
Click to expand...
Click to collapse
Yeah that would be a perfect example of how you could use it. And that would be a lot safer to have a task automation app perform those steps for you instead of having to do it yourself while driving.
I'll start working on this in a week or so (as soon as I can get Scrobble finished up and to a point where people stop requesting more features! ) and see if can be ported over.
It should be easy; there are just a couple Win32 library calls it makes that I'm not sure are available in WinMo 6.1:
Code:
// imports mouse_event function from user32.dll
[SRI.DllImport("user32.dll", CharSet = SRI.CharSet.Auto, CallingConvention = SRI.CallingConvention.StdCall)]
public static extern void mouse_event(int dwFlags, int dx, int dy, uint cButtons, uint dwExtraInfo);
// imports keybd_event function from user32.dll
[SRI.DllImport("user32.dll", CharSet = SRI.CharSet.Auto, CallingConvention = SRI.CallingConvention.StdCall)]
public static extern void keybd_event(byte bVk, byte bScan, uint dwFlags, uint dwExtraInfo);
These two functions mouse_event() and keybd_event() poll for all mouse and keyboard events (clicks, movement, keypresses, etc.) globally... in any window, program, and so on.
Does anyone know off the top of their head if user32.dll is also available in Windows Mobile 6.1 Professional?

I am *VERY* interested in this application. How is the porting coming? I can't wait!!!

Man. That would be a revolution for us ppccusumizenerds! Holy ****! ..that would actually be Holy ****!

There is a version of AutoHotKey for Pocket PCs / WinCE, still in development, but a lot of it working, see here http://www.autohotkey.com/forum/topic27146.html&highlight=wince.

I'm very interested. In fact, I was looking for such an application but gave up finding.
Looking forward.
Thanks.

Hi,
if it's getting as good as Scrobble, then I vote for it . This would be a very handy feature, moreover very clever.
I would test it with pleasure.
Greets.

It will be a very useful app!
Looking forward to it, in the meanwhile I'll play with XP version!!

Related

Absuluut newbie, help on eMbedded C++ 4.0 please

Hello,
I'm a Visual Basic programmer for some time now.
Made some useful stuff they tell me.
Used C++ (Borland) about 10 years ago, so that’s a bit rusty.
Now I've ordered a Qtek 9090, and I would want to develop some software for it to. So I downloaded and installed the SDK and eMbedded C++ 4.0.
I thought, I start out on the emulator......
I can't even get my own "Hello world" program to work........
I have downloaded a "Hello World" program which I stepped through in debug mode. I have NO idea what they are doing there.
It contains about 20 files, hundreds lines of code, just to put "Hello World" on the screen of the emulator.
And I hoped that:
Code:
#include <stdio.h>
main()
{
printf("Hello, world!\n");
return 0;
}
pleased in a form, would do the trick………
The help in the IDE does not work.
Re-install it tell's me. I have done so, but the help function does not work.
Where is the "visual" part in the embedded Visual C++?
How do I place forms and buttons e.g.?
I have no idea where to start now.
Searched a lot of forum's for starters-help, but I can not find anything that helps me on my way. I just hope I've not become stupid.....
Would somebody please help me on my way?
Can I wholeheartedly recommend the book "Programming Windows CE", by Douglas Boling? It's normally cheap (or the second edition is) on ebay and it really is good.
Failing that, you're writing a console based application for something that uses a windowing environment by default, so you'll either have to change what you're linking to, or have a winmain that makes use of a graphical UI rather than stdout. Call MessageBox perhaps? This is all made *so* much easier with a working help system that you need to get that working.
You can manage resource files visually, so it really is Visual development. Plus, for free, it's an excellent development tool. Well, it isn't bad.
The best advice I can give is to get your machine set up correctly with EVC2002, or EVC 4 with SP4 and the appropriate SDKs, and take it from there.
Good luck starting out.
Cheers,
Nick.
chiark said:
Can I wholeheartedly recommend the book "Programming Windows CE", by Douglas Boling?
Click to expand...
Click to collapse
Thanx. I'm going to order that book.
Failing that, you're writing a console based application for something that uses a windowing environment by default, so you'll either have to change what you're linking to, or have a winmain that makes use of a graphical UI rather than stdout. Call MessageBox perhaps?
Click to expand...
Click to collapse
Well, yes. I know. Like I sayed, I usualy work with VB. It was just me, trying to oversimplify things.
What I ment to express is that I'm pretty supprised I still have to write the message-loop and the main-loop and the jsadgkh-loop and....
I just hoped to put up some forms and attach code to it. But maybe I'm missing the clue on this.
This is all made *so* much easier with a working help system that you need to get that working.
Click to expand...
Click to collapse
I have set it up on an other machine yesterday, and there the help works.
Today I'm going to make use of it.
You can manage resource files visually, so it really is Visual development. Plus, for free, it's an excellent development tool. Well, it isn't bad.
Click to expand...
Click to collapse
Well.... That part, the visual part, I don't see yet, but like I sayed, I'm going to work throuhg the help, now that I've got that working.
And a 'free' tool. Well, that's allways nice. I think it is good for us, AND good for them. The more software there will be on the market, the better the devices sell.
The best advice I can give is to get your machine set up correctly with EVC2002, or EVC 4 with SP4 and the appropriate SDKs, and take it from there.
Good luck starting out.
Cheers,
Nick.
Click to expand...
Click to collapse
Thanks for you tips.
Rens
Dox, drop me a PM, I've got an old copy of the book you can have if it would help
Re the message loop stuff, you've indeed got options. You can either use the message loop approach hitting the API directly, or you can opt for using MFC to abstract the stuff away from you.
Personally, I prefer the straightforwardness of using the API rather than MFC. By the time you've written one application, you've got the bulk of the next . I also write for older machines, and the overhead of MFC is a consideration, but on the XDA it really isn't.
If the application is simple, it can all be handled by a DialogBox. You will need to write a DialogProc to handle the appropriate messages, but the need to register a window class, get messages off the queue etc is removed from you. Similarly, you can have multiple pages on a single dialog box using propertypages.
If you did want to write a console application, you can do this but you need to change the linker options within EVC.
Have a good look at the samples, too, there's some real good stuff in there.
Cheers, and good luck
Nick.

how to port a palm program to my O2

I started using the O2 about two years ago but realized that I couldn't let go of my Palm because of a program (MathPad). Does anybody know how to port this program to the O2 so I don't have to always bring 2 pda's with me (O2 and palm)? OR is anybody familiar with a similar program on the pocket pc OS. A short description of the MathPad below.
Aki
MathPad is a tool for solving and storing mathematical equations in standard algebraic syntax. It works just like the standard MemoPad app, except that if you write down an equation and tap the Solve button, it computes the answer and fills it in for you. These equations can be simple math expressions like "2+2=", or algebraic expressions using variables such as "sqrt(x+4) / acos(0.7) = y**3". MathPad provides operators for exponentiation, bitwise AND, OR, NOT, and XOR, bit shifts, integer or modulo division, comparisons, and Boolean logic. Functions for trigonometry (including inverse and hyperbolics), logarithms, and date manipulation are also provided. MathLib is required for use of the trigonometric functions, but all other features work on any Pilot-compatible PDA, running any OS version
if you by port mean recompiling then that very much depend on using what tool the application was made
if you just want to run the program ...
http://news.com.com/2100-1040-270567.html?legacy=cnet
There are a couple of palm emulators for pocketpc as well.
Some work very well.
V
Thanks Rudegar for the link. I found the article quite interesting. Wish they had some sort of trial version for the software. Getting the ROM seem quite tricky. I also noticed that it was dated 2001... any idea on where it is now?
Thanks too Vijay,
Would you have a specific emulator you can recommend? I tried it out when I first got the O2 but it never ran and I gave up on the emulator.
use styletap to run most palm apps on your ppc
http://styletap.com/
if you need help send me a pm.. your pinoy din dba?

Kinetic Scrolling Demo **Updated** KListControl with source

Hi
New around these forums..
I've posted a in-progress of a project I'm working on. It's a kinetic scroller (you know that flick scroll effect). Remember this is a demo it doesn't actually do anything useful apart from amuse me!
Not as fluid/cool as iContact, but it's my first PPC application. The grand plan is to turn it into a library based MP3 player with a decent looking interface.
It's written in CF .NET so if you really need the source reflection is your friend.
Tested on a WM6 blueangel device @ 400Mhz. Runs in the WM2003 emulator
----
I've updated with source. No license, do whatever you want with it. Although a mention somewhere would be nice
Chad get this media player out the door now!
-------
New optimized demo released, source now updated.
Removing old source as the file name is confusing.
Thanks for all the comments.
-------------------------------------------------
**************************************
UPDATE:
gingercat has done some fantastic work loosely based on the original source and created a user control. Unlike my old code it doesn't use one big bitmap and just better written in every aspect. I'll leave my old source up just for reference as to how /not/ to write a kinetic scroller
I can't try it right now because I don't have my device, but it's nice to know that at least a few people still support WM2003/SE...
jackbnymbl said:
I can't try it right now because I don't have my device, but it's nice to know that at least a few people still support WM2003/SE...
Click to expand...
Click to collapse
...especially on wizard..
LOVELY! Why don't we work together to bring your scrolling routine, into my existing mp3 player "Melody". I've got playback and that sort of thing sorted out. Please PM me if you're interested.
anyone care to post a vid plz
slow scrolling and not as responsive as other scrolling software out there... but the idea is there ... i would also love to see smtg similar implemented in chad's media player (just my simple opinion)...
thundershadow14 said:
LOVELY! Why don't we work together to bring your scrolling routine, into my existing mp3 player "Melody". I've got playback and that sort of thing sorted out. Please PM me if you're interested.
Click to expand...
Click to collapse
Thanks for the offer! This is a hobby project and I'd like to work on my own.
However I'm now going to release the source so you can use it..
Kinetic scroller, officially a part of Melody.:
http://forum.xda-developers.com/showthread.php?t=325223
Development
Hi
I was just wondering, how long will it take for you to make your product compatible to play Mp3 Songs, because I'm tierd of waiting for a Music Player, which is easy to use and fast. And by the way, I think your player is so far the best, it just has to get a litle better UI!!!
Well, here I am with release 002 of my kinetic scroller demo.
I've added alot of optimizations and its silky smooth on my 400Mhz device! It even runs great underclocked at 200Mhz.
Source to follow (once its cleaned up, probably tommorrow)
Thanks for this! Once again shows how it just takes one person to come up with a great idea (apple (or whoever initially came up with smooth scrolling)) then we all wonder how we lived without it!
I've just been reflecting over it and note that you are relying on .NET garbage collection to clean up e.g. all the graphics and brush objects you create - you need to be careful about this because this isn't deterministic and you can quickly run out of resources before it gets round to cleaning up. I know you say you're going to clean up the code anyway, but just thought I'd add my tip!
The holy grail would be if we can figure out how to hook mouse events, because then mouse movement can be processed independently of the form (and any other items on it). Unfortunately, CE doesn't support this (that I know of). The form approach only works if everything is semi-custom drawn.
This new version scrolls as good as or better than iContact, so you can remove that message on the first post.
on the other hand, the version currently implemented in melody v0.6 doesn't seem as good as this one.
btw, once you upload the new source, i'll see if i can make it stop selecting the first touched item when you are trying to scroll.
when thundershadow and i were making our own one we found the way to do this was to do something like listbox1.selectedindex = -1
it should be pretty easy to do.
also, something like this instead of the random number generator could get a list of the files in the current dir:
Code:
string[] r = System.IO.Directory.GetFiles(System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase),".mp3");
klist = new KList(0, 20, screenX, screenY, "All Tracks");
for (int i = 0; i < r.Length; i++)
{
KItem ki = new KItem(i + ". " + r[i] + ".mp3");
klist.addItem(ki);
}
dunno if that is accurate or not.. haven't used c# that much.. but it should be easy todo.
Source is now up.
I've starting playing around with MP3 playback but please ignore it (Using the FMODCE .NET wrapper)
dosfan said:
Source is now up.
I've starting playing around with MP3 playback but please ignore it (Using the FMODCE .NET wrapper)
Click to expand...
Click to collapse
if you're intending on making it a practical-use app,
probably the best way to go about it is using the shell execute function to open the mp3's in whatever player they associated mp3's to (cos people will want features they prefer than other media players).
and then later on you can add an option to customize the command so the user can use it with a different media player without changing the associations.
so they'd have to make something like: "\SD Card\TCPMP\player.exe /open %mp3path%".
then the app just has to replace "%mp3path%" with the variable for the path to the selected mp3, and launch everything before it to shell.
you'd also need to add something like the code in my last post to get a list of the mp3's (tried it on my ppc and it doesn't work, so it needs to be fixed up though).
chrismrulz said:
if you're intending on making it a practical-use app,
probably the best way to go about it is using the shell execute function to open the mp3's in whatever player they associated mp3's to (cos people will want features they prefer than other media players).
and then later on you can add an option to customize the command so the user can use it with a different media player without changing the associations.
so they'd have to make something like: "\SD Card\TCPMP\player.exe /open %mp3path%".
then the app just has to replace "%mp3path%" with the variable for the path to the selected mp3, and launch everything before it to shell.
you'd also need to add something like the code in my last post to get a list of the mp3's (tried it on my ppc and it doesn't work, so it needs to be fixed up though).
Click to expand...
Click to collapse
Yes, that something I was already considering.
To be honest, I'm not impressed with FMOD's performance. Even just initalizing the library is causing performance issues (without even playing a MP3, does fmod.init() spawn a thread or something???)
I'm looking for a port of MAD that I could interop with. If anyone knows of a libmad.dll for ARM WINCE point me in the direction!
dosfan said:
Yes, that something I was already considering.
To be honest, I'm not impressed with FMOD's performance. Even just initalizing the library is causing performance issues (without even playing a MP3, does fmod.init() spawn a thread or something???)
I'm looking for a port of MAD that I could interop with. If anyone knows of a libmad.dll for ARM WINCE point me in the direction!
Click to expand...
Click to collapse
afaik, performance-wise fmod would be the best library to use.
but the problem is that most people would rather use their own player like tcpmp or wmp that does what they want,
rather than just a basic player with a third-party library in .net cf.
New UserControl version
Hi dosfan,
I have modified the source to create a new KListControl which is a UserControl you can add to any .NET form. All the scroll functionality required is all contained within the new control.
This control doesn't pre-render everything up-front, so should be less memory hungry (especially with long lists) at the slight expense of some speed (runs fine on my hermes).
Each item is now custom drawn, and only needs to support an IKListItem interface - this enables each item to draw whatever it wants, whenever it wants (well, by nicely asking its parent to invalidate it when visible). I have created a basic KListItem object that supports string name, object value (and has the same functionality you provided).
I also updated the project to still compile with the new source, so (if you like the changes) you can continue work from there.
Updates I will still make are:
Better use of statics incase multiple lists are used (currently the background selection image is static)
Common timer between multiple instances of the control (for performance).
Hope you don't mind my changes!
Chris.
i've just modified gingercat's version to launch the selected mp3 using the windows shell.
to test it out you need to create a directory called "\\SD Card\\My Music", or change the variables in form1 and the klistcontrol to where your music dir is.
if the directory doesn't exist it will browse for mp3 files in the app's directory, then grab the folder of the one selected.
this is not a practical idea, and it won't change the variable in the klistcontrol,
so it wont be able to launch it through shell if you use the browsing method.
a better way would be to make it a folderbrowser dialog instead of a file one,
then make the folder variable in form1 a global variable, and the klistcontrol just grabs it from form1.
that still wouldn't work for subdirectories though.
for that you'd need to tag each klistitem with it's full file path or directory when it's being added.
also it should be pointed out that gingercat's version scrolls a bit too fast.
it's smooth so there aren't any performance issues.
it just goes too far with the tiniest tap up or down.
is there any way to capture all mouse events of the system?

Application1 to control App2 (VisualStudio2008)

Hello!
I'm developing one application in VS2008 for my pocket pc, and I need some help to continue with it.
I need to make the buttons of the application1 run even when the application2 is running and try to control it with application1 buttons, but I don´t know if it's possible!?
For example, is it possible to move between items on "windows mob. file explorer" using the up and down keys/buttons of application1?
The application1 only fills 1/3 of the screen, and I still seen windows explorer
When I try to do it, the application1 came to the "top" and windows file explorer control seems to be disable.
Is it possible? Any tips for it?
Regards
Have a look into the SendMessage API call. It should be able to do what you want.
Northernmost said:
Have a look into the SendMessage API call. It should be able to do what you want.
Click to expand...
Click to collapse
I agree. You basically need to catch WM_KEYDOWN messages (and any other you want to pass) and send them to file explorer... I think the tricky part is knowing what application is running directly underneath yours. Post here how you did it if you manage to achieve all that
Arlanthir said:
I agree. You basically need to catch WM_KEYDOWN messages (and any other you want to pass) and send them to file explorer... I think the tricky part is knowing what application is running directly underneath yours. Post here how you did it if you manage to achieve all that
Click to expand...
Click to collapse
Hi!
Ok, I will post here the code of application. Take a look at it and say something about.
Here goes the code:
Code:
Imports System
Imports System.Runtime.InteropServices
Public Class Form1
<DllImport("coredll.dll", CallingConvention:=CallingConvention.Winapi, CharSet:=CharSet.Unicode, EntryPoint:="keybd_event", SetLastError:=True)> _
Public Shared Sub keybd_event(ByVal bVk As Byte, ByVal bScan As Byte, ByVal dwFlags As Integer, ByVal dwExtraInfo As Integer)
End Sub
Private Sub ExitButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ExitButton.Click
'Bye!
Application.Exit()
End Sub
Private Sub UpButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles UpButton.Click
Const VK_UP As Byte = &H26
keybd_event(VK_UP, 0, 0, 0)
'Up
End Sub
Private Sub LeftButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles LeftButton.Click
Const VK_LEFT As Byte = &H25
keybd_event(VK_LEFT, 0, 0, 0)
'Left
End Sub
Private Sub DownButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DownButton.Click
Const VK_DOWN As Byte = &H28
keybd_event(VK_DOWN, 0, 0, 0)
'Down
End Sub
Private Sub RightButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RightButton.Click
Const VK_RIGHT As Byte = &H27
keybd_event(VK_RIGHT, 0, 0, 0)
'Right
End Sub
End Class
Do you think it is possible to control any other application with this?
I don't want only control windows explorer, I want to control other applications, including games.
Tanks for help.
Regards
I'm not getting what you want to do with it.
You're designing something like a userbar that's always staying on top but letting you interact with the application directly underneath it;
OR
You're making a "remote control" application to send various commands to different programs, which you specify hardcoding.
Now the control is an easy one (at least in C++) but actually getting what application is underneath yours may be tricky. Can't help much more there, specially with another language. Have you searched msdn?
Hello.
So, I mean to do a virtual d-pad cause I have one of my pocket pc dont have any!
See this post
This is what I want to do.
I think this will be, like you said, a little bit "tricky".
But, if some one could help, I think it will work.
I don't have many skills programming mobile applications.. so every tips and examples are welcome.
Regards
What? That changes everything! xD
On the first post you said you wanted to make the "up and down buttons" sent to app1 change app2... Well, I thought you were talking hardware keys here
(thus the WM_KEYDOWN event)
What language are you using and in what way do you interact with the touchscreen? Did you understand when I said you had to catch the events?
Basically, you want to catch touchscreen (mouse) events, compare the mouse coordinates to those of your buttons (let's say it was a MOUSEDOWN in the LEFT button area), get the window directly below you and post a WM_KEYDOWN message with the LEFT code to it.
The only problems in doing this in C++ for me right now (I'm also a beginner ) would be creating a window that doesn't cover the screen and getting the window below. The rest is really easy
Arlanthir said:
What? That changes everything! xD
On the first post you said you wanted to make the "up and down buttons" sent to app1 change app2... Well, I thought you were talking hardware keys here
(thus the WM_KEYDOWN event)
What language are you using and in what way do you interact with the touchscreen? Did you understand when I said you had to catch the events?
Basically, you want to catch touchscreen (mouse) events, compare the mouse coordinates to those of your buttons (let's say it was a MOUSEDOWN in the LEFT button area), get the window directly below you and post a WM_KEYDOWN message with the LEFT code to it.
The only problems in doing this in C++ for me right now (I'm also a beginner ) would be creating a window that doesn't cover the screen and getting the window below. The rest is really easy
Click to expand...
Click to collapse
Hi!
I'm using Visual Studio 2008 to code it.
Creating a window that cover only 1/3 of the screen, in VisualStudio is not difficult. If you have VS2008, I can send you the project for your email and so you can take a look at it.
If I understand, you can make this work coding it in C++, so we can share both parts... the 1/3 screen window and the way to make app1 control any other app2, cause I have no idea how to make app1 control app2!!!!!
Tanks.
all bull ****
Guys This Is Crap>>>>>>believe Me
jawad786 said:
Guys This Is Crap>>>>>>believe Me
Click to expand...
Click to collapse
?? Why this "is crap" ??
It's a mobile application development try like any other one!
ImpactMan said:
Hi!
I'm using Visual Studio 2008 to code it.
Creating a window that cover only 1/3 of the screen, in VisualStudio is not difficult. If you have VS2008, I can send you the project for your email and so you can take a look at it.
If I understand, you can make this work coding it in C++, so we can share both parts... the 1/3 screen window and the way to make app1 control any other app2, cause I have no idea how to make app1 control app2!!!!!
Tanks.
Click to expand...
Click to collapse
You are aware that Visual Studio actually lets you code in different languages, I hope.
Arlanthir said:
You are aware that Visual Studio actually lets you code in different languages, I hope.
Click to expand...
Click to collapse
Yes. I know that!
So, you think in C++ is possible to make it work?
Have any idea how to? Any tips?
Tanks for help.
Regards
I've already told you what I do know, now for the rest someone has to dig up the information from msdn... I don't have the time right now, as I'm working on something else on the little spare time I have But if you do find a way to do the rest I'll gladly help you with what I can do now.
Arlanthir said:
I've already told you what I do know, now for the rest someone has to dig up the information from msdn... I don't have the time right now, as I'm working on something else on the little spare time I have But if you do find a way to do the rest I'll gladly help you with what I can do now.
Click to expand...
Click to collapse
OK. Tanks for your availability.
I will try to make some progresses... Let you know than.
Regards.
Google is your friend - http://www.google.co.uk/search?q=compact+framework+sendmessage+send+keystroke
Top of the list (http://www.c-sharpcorner.com/Forums/ShowMessages.aspx?ThreadID=40803) looks promising. Note the use of PostMessage rather than SendMessage. It appears SendMessage requires the target app to have focus to work reliably... where as PostMessage doesn't. You learn something new every day
dont know if ur coding something to control only one specific program, but if its for all programs maybe a sip input panel do the same in an easier way
Northernmost said:
Google is your friend - http://www.google.co.uk/search?q=compact+framework+sendmessage+send+keystroke
Top of the list (http://www.c-sharpcorner.com/Forums/ShowMessages.aspx?ThreadID=40803) looks promising. Note the use of PostMessage rather than SendMessage. It appears SendMessage requires the target app to have focus to work reliably... where as PostMessage doesn't. You learn something new every day
Click to expand...
Click to collapse
Tanks for the links.
I've already take a look at it, and now I'm going to try understand it and try to adapt something like to my application.
I will see the to ways... PostMessage and SendMessage.
Regards.
Keep the development goin! Looks like a very interesting project I'll keep track, since I have an Omnia anyway.
Unfortunately I cannot help since I'm a begginer still stuck on Turbo C++ 3.0 (LOL, seriously-awesome right?)

playing audio files in an app

Hi there
I am desperate for advice and support on how to develop an android app that plays music audio files.
The app itself would have a home screen, about screen and a tracks screen.
The user when they navigate to tracks screen would have a list view of music audio files they can listen to on their android device.
The music audio file itself can either be stored in a SQL server database or ftp site , I don't know what would be best in terms of delivering optimal performance for end user?
The app would be like a service that would just play in the back ground allowing users to use their phone whilst listening to the music track(s).
My problems are:
- how can I actually develop this?
- there are no tutorials on the net, all music playing apps on YouTube, stack overflow and other websites do not show how to read music from SQL or ftp server.
I would be eternally grateful to anyone who could kindly advise me:
- best way to store each music audio file? Ftp or SQL
- in any case SQL would have to be used I believe to store the weblinks if I were to use FTP
- each music file of which there are around 150-180 is around 100mb in size and is of mp3 quality
Please , please , please can you help me develop this? Or guide me so I may be able to do it.
Please advise me on best way to set this up and get me started...
Thank you in advance
xirokx said:
Hi there
I am desperate for advice and support on how to develop an android app that plays music audio files.
The app itself would have a home screen, about screen and a tracks screen.
The user when they navigate to tracks screen would have a list view of music audio files they can listen to on their android device.
The music audio file itself can either be stored in a SQL server database or ftp site , I don't know what would be best in terms of delivering optimal performance for end user?
The app would be like a service that would just play in the back ground allowing users to use their phone whilst listening to the music track(s).
My problems are:
- how can I actually develop this?
- there are no tutorials on the net, all music playing apps on YouTube, stack overflow and other websites do not show how to read music from SQL or ftp server.
I would be eternally grateful to anyone who could kindly advise me:
- best way to store each music audio file? Ftp or SQL
- in any case SQL would have to be used I believe to store the weblinks if I were to use FTP
- each music file of which there are around 150-180 is around 100mb in size and is of mp3 quality
Please , please , please can you help me develop this? Or guide me so I may be able to do it.
Please advise me on best way to set this up and get me started...
Thank you in advance
Click to expand...
Click to collapse
sounds like you need to do lots more research and maybe a few tutorials for a better understanding. I would suspect 99% of developers would host file though http/s (not ftp) and yes all song info and metadata in SQL and delivered though php.
Binary Storage in SQL is not out of the question using BLOBS but not well suited in your case.
hope that helps, sounds simple enough
sounds like you need to do lots more research and maybe a few tutorials for a better understanding.
Click to expand...
Click to collapse
thanks for your reply
i have tried looking for tutorials for hours on end and its a very niche area, i could not find any.....do you know of any? have you tried looking for tutorials?
I would suspect 99% of developers would host file though http/s (not ftp) and yes all song info and metadata in SQL and delivered though php.
Click to expand...
Click to collapse
how do you host mp3 files using HTTPs ?
sounds simple enough
Click to expand...
Click to collapse
if its that simple, perhaps you would not mind guiding me to acheive it?
the page in the app which contains the mp3 files would have a listview or gridview with the names of the mp3s so when user clicks on them the mp3 plays in the background...
perhaps you can create an example if possible? i would be so grateful.
thank you
xirokx said:
i have tried looking for tutorials for hours on end and its a very niche area, i could not find any.....do you know of any? have you tried looking for tutorials?
Click to expand...
Click to collapse
You will never find a tutorial to do an exact app for what you want But you will find 1000's of how to store and use data from a database, 1000's for how to use mySQL and php in android, 1000's for listviews and gridviews powered by adapters and data and again 1000's or hundreds on how to stream audio from web servers using android
xirokx said:
how do you host mp3 files using HTTPs ?
Click to expand...
Click to collapse
upload them ? not sure what your question is here, you place the file on the server and use the URL ?
xirokx said:
if its that simple, perhaps you would not mind guiding me to achieve it?
the page in the app which contains the mp3 files would have a listview or gridview with the names of the mp3s so when user clicks on them the mp3 plays in the background...
perhaps you can create an example if possible? i would be so grateful.
thank you
Click to expand...
Click to collapse
It contains such a generic set of tasks you really dont need me to write it for you.... I'm always happy to answer direct specific questions, but you will seldom get an answer for "how do I do x app"... but like I said, what you want is very common, so there is tonnes of resource online
thanks for your reply
You will never find a tutorial to do an exact app for what you want But you will find 1000's of how to store and use data from a database, 1000's for how to use mySQL and php in android, 1000's for listviews and gridviews powered by adapters and data and again 1000's or hundreds on how to stream audio from web servers using android
Click to expand...
Click to collapse
If only the world was perfect and I could find an "exact" tutorial.....If I thought it was that easy I would never have started my thread.
really? 1000s or 100s.....yet you cannot point me to one?
It contains such a generic set of tasks you really dont need me to write it for you.... I'm always happy to answer direct specific questions, but you will seldom get an answer for "how do I do x app"... but like I said, what you want is very common, so there is tonnes of resource online
Click to expand...
Click to collapse
if it is that generic and simple, I do not understand why you cannot guide me more, at least to the 1000's or 100's of tutorials you claim that exist and especially as I have mentioned I cannot find them.
Try and see it from my point of view, I am new to this, trying, well actually REALLY REALLY want to learn, have spent hours researching for adhoc tutorials that will enable me to grasp the "generic" concept and have not found much / anything to help me.
Then you come along and make such a bold claim basically saying its "simple and easy, generic and quite straightforward" yet you cannot backup your claim by providing any of these "easy to find, 1000's or 100s tutorials" and are not willing to help any more then this.
Personally if I thought something was that easy, how much of my valuable time is it really going to take me, to provide someone who wants to learn with a few lines of code to get them started, especially after making such BOLD claims....
If I was not willing to, I would not even bother replying, it would have been far more beneficial if you responded with some example code rather then claiming how simple it was to do, I see no evidence that is it so easy only your claims...
Thanks for your time
Seriously though, this is me using google
http://developer.android.com/guide/topics/data/data-storage.html
http://developer.android.com/training/basics/data-storage/databases.html
http://www.vogella.com/tutorials/AndroidSQLite/article.html
http://www.androidhive.info/2012/05/how-to-connect-android-with-php-mysql/
http://www.androidhive.info/2012/05/how-to-connect-android-with-php-mysql/
http://www.mybringback.com/tutorial...-using-remote-databases-php-and-mysql-part-1/
http://forum.xda-developers.com/showthread.php?t=2325799
http://developer.android.com/guide/topics/media/mediaplayer.html
http://stackoverflow.com/questions/18174068/how-to-play-the-online-streaming-radio-in-android
http://stackoverflow.com/questions/1965784/streaming-audio-from-a-url-in-android-using-mediaplayer
if you use google you will find 1000's more results, they were just the top ones really, not sure why you cant find any...seriously pages and pages of relevant results, what were you actually searching for ? as in search terms ... maybe thats the prob ?
Also yes it is generic and yes almost every app uses those components and has had to complete those tasks. Trust me on this, remote database + online resources are in 90% of apps But it's the tasks that have 1000s of tutorials and reference, not the app.... like i say "android database tutorial", "android mysql online database","android media stream url"
hope that helps
thanks alot....I will check them out and get back to you
so grateful for your help
maybe you can solve this, perhaps its "challenging" enough for ya
this is my android java code that a) connects to my db b) uses the Name field from my db to populate a listview in my app c) when any single listview item is selected, it uses the name in the listview matches it to the dbName and plays the dbFile which contain a URL to where the mp3 is stored:
Code:
private void connect() {
List<String> r = new ArrayList<String>();
ArrayAdapter<String>adapter=new ArrayAdapter<String>(getApplicationContext(), android.R.layout.simple_list_item_1,r);
final ListView list=(ListView)findViewById(R.id.listView1);
try {
DefaultHttpClient client = new DefaultHttpClient();
HttpGet request = new HttpGet("myServer/android/files.php");
HttpResponse response = client.execute(request);
HttpEntity entity=response.getEntity();
data=EntityUtils.toString(entity);
Log.e("STRING", data);
try {
JSONObject jsonResponse = new JSONObject(data);
JSONArray jsonMainNode = jsonResponse.optJSONArray("mp3s");
for (int i = 0; i < jsonMainNode.length(); i++) {
JSONObject jsonChildNode = jsonMainNode.getJSONObject(i);
ID = jsonChildNode.getInt("ID");
name = jsonChildNode.getString("Name");
FileName = Uri.parse(jsonChildNode.getString("FileName"));
Log.e("STRING", name);
//r.add(ID);
r.add(name);
list.setAdapter(adapter);
list.setOnItemClickListener(new OnItemClickListener() {
public void onItemClick(AdapterView<?> parent, View view,int position, long id) {
MediaPlayer mp = new MediaPlayer();
try{
mp.setAudioStreamType(AudioManager.STREAM_MUSIC);
mp.setDataSource(getApplicationContext(), FileName);
mp.prepare();
mp.start();
}
catch(IOException e)
{
System.out.println(e);
}
}
});
}
} catch (JSONException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
} catch (ClientProtocolException e) {
Log.d("HTTPCLIENT", e.getLocalizedMessage());
} catch (IOException e) {
Log.d("HTTPCLIENT", e.getLocalizedMessage());
}
}
Problem is:
- It doesnt open mediaplayer or streaming player on the emulator
- If track 1 is playing and I click on track 3 it plays both tracks simulateously
- as there is no media/stream player view you cannot pause/stop/play the track that is being played
pls help me fix these issues, if you can
thanks
p.s. I did use your links to get me this far, now I am genuinely stuck and would really appreciate a hand
thanks appreciate it
xirokx said:
Problem is:
- It doesnt open mediaplayer or streaming player on the emulator
Click to expand...
Click to collapse
Dont work with the emulator at all, I only use real devices, but if you mean the media player app, then thats due to you not using it. You're using the media player class.
xirokx said:
- If track 1 is playing and I click on track 3 it plays both tracks simulateously
Click to expand...
Click to collapse
Thats cause you create another instance that every click (or new instance rather). I would assume that you just should have 1 and stop/reuse it.
xirokx said:
- as there is no media/stream player view you cannot pause/stop/play the track that is being played
Click to expand...
Click to collapse
Well you would create buttons to do that yourself.
I am now debugging my app on my device
I have changed the code a little so only 1 file plays at any one time and it works....
list.setOnItemClickListener(new OnItemClickListener() {
public void onItemClick(AdapterView<?> parent, View view,int position, long id) {
//playAudio(FileName);
Uri uri = FileName;
Intent intent = new Intent(Intent.ACTION_VIEW, uri);
startActivity(intent);
}
Click to expand...
Click to collapse
However when I click on the list item, a menu opens up asking which browser I want to play the file in....when instead it should open a list of mediaplayers for me to play the file in.
How can I change it?
Thanks for your help.
xirokx said:
I am now debugging my app on my device
I have changed the code a little so only 1 file plays at any one time and it works....
However when I click on the list item, a menu opens up asking which browser I want to play the file in....when instead it should open a list of mediaplayers for me to play the file in.
How can I change it?
Thanks for your help.
Click to expand...
Click to collapse
well thats the way it will work if down to the user not choosing a default and also the way you set it up.... I do reccomend you read the android docs like http://developer.android.com/guide/components/intents-filters.html
it will help when asking question and most of the time you wont have to ask cause the answers are there.

Categories

Resources