Help with sendKeys or similar function - Windows Phone 7 Development and Hacking

Hello, im developing a Remote Keyboard app.
it works good with my own app. I use my pc to send the pressed keys to a ip socket. My device reads this streams and outputs to text box.
But now i want to make this more useful... i whish to send keys to any app. Like the SendKeys function on windows. So, there is no such function on wp7... at least officially. Can anyone help me with this? Im not quite familiarized with dllimport project or any non oficial library and how to access forbiden functions in wp7.
Can anyone give me a little help with this ?
Thanks

Code:
keybd_event(<key code>, 0, KEYEVENTF_SILENT, 0);
keybd_event(<key code>, 0, KEYEVENTF_SILENT | KEYEVENTF_KEYUP, 0);

How !!! Thank you ! I need to use with dllimport? ... how can i find this info ?
Thanks

ultrashot said:
Code:
keybd_event(<key code>, 0, KEYEVENTF_SILENT, 0);
keybd_event(<key code>, 0, KEYEVENTF_SILENT | KEYEVENTF_KEYUP, 0);
Click to expand...
Click to collapse
ultrashot, could you please give me more details?
Thanks.

Rather than mess with the DllImport Project, just call the function directly. Write some C++ (it hasn't killed anybody yet, so far as I know) following the API as documented on MSDN. Heathcliff74 has written a pretty good guide for developing native code on Mango.
Note that to send keyboard events to other apps, you'll need your app to be running in the background. On a fully-unlocked ROM, this is pretty easy (write the whole thing as a native EXE without a UI) but on a stock ROM it's a bit harder.

Thank you. worked perfectly. My only sadness is that it only works for special keys such as volume, play, home, back, search and others. My goal is to be able to send char keys. for that I'm starting another project. The thread is this:
http://forum.xda-developers.com/showthread.php?p=26821397#post26821397
Thanks everyone

Related

CheckBox state presrving/restoring

Hi there,
Does anyone out there how to preserve/restore the transient state of a CheckBox and/or Radio button?
So far, I'm using the following code, working for textbox
Code:
Public Sub PreserveState_TextBox(ByVal TB As TextBox)
Dim buffer As String = String.Empty
If True = PhoneApplicationService.Current.State.ContainsKey(TB.Name) Then
buffer = TryCast(PhoneApplicationService.Current.State(TB.Name), String)
If Not String.IsNullOrEmpty(buffer) Then
TB.Text = buffer
End If
End If
End Sub
Public Sub RestoreState_TextBox(ByVal TB As TextBox)
If True = PhoneApplicationService.Current.State.ContainsKey(TB.Name) Then
PhoneApplicationService.Current.State.Remove(TB.Name)
End If
PhoneApplicationService.Current.State.Add(TB.Name, TB.Text)
End Sub
it possible to modify the above code to work for Checkbox and/or Radiobutton?
If not, any ideas?
So far, I've been trying the sample "Tombstoning" sample code from Microsoft without any luck...
Thanks in advance!
Hi,
I'm not a VB developer, but storing the state of a checkbox is not much different from storing any other primitive type. What you could do is have a bool variable "isCbChecked" and store that bool state in your PhoneApplicationService.State.
Code:
PhoneApplicationService.Current.State.Add("isCbChecked", myCheckbox.IsChecked)
Then, when you're restoring your app, simply do
Code:
myCheckbox.IsChecked = (bool)PhoneApplicationService.Current.State.ContainsKey("isCbChecked");
keyboardP said:
Hi,
I'm not a VB developer, but storing the state of a checkbox is not much different from storing any other primitive type. What you could do is have a bool variable "isCbChecked" and store that bool state in your PhoneApplicationService.State.
Code:
PhoneApplicationService.Current.State.Add("isCbChecked", myCheckbox.IsChecked)
Then, when you're restoring your app, simply do
Code:
myCheckbox.IsChecked = (bool)PhoneApplicationService.Current.State.ContainsKey("isCbChecked");
Click to expand...
Click to collapse
Thanks a lot for your fast reply.
Can I ask for additional help on how to make your statements into generic procedures, at least to take them to something similar to what I posted?
Don't care if it's in C#
Thanks in advance!
GFR_2009 said:
Thanks a lot for your fast reply.
Can I ask for additional help on how to make your statements into generic procedures, at least to take them to something similar to what I posted?
Don't care if it's in C#
Thanks in advance!
Click to expand...
Click to collapse
Off the top of my head, something like this should work (C# code).
Code:
public static T RestoreState<T>(string key)
{
if (PhoneApplicationService.Current.State.ContainsKey(key))
{
return (T)PhoneApplicationService.Current.State[key];
}
return null;
}
'T' is the type that will be used. In C# 'T' is a special character denoting the generic type, not something I just used
So in the code above, the return type is 'T' and when using RestoreState, it will be 'RestoreState<Textbox>("TB.Name");'. The value of 'TB.Name' will be searched within the dictionary and, if it's found, it will cast that object as 'T' (Textbox) and return it, otherwise it will return null.
Hi,
So far, I did the following and while no error is raised, nothing happens...
Code:
Public Function Backup(ByVal token As String, ByVal value As Object) As Boolean
If Nothing Is value Then
Return False
End If
Dim store = PhoneApplicationService.Current.State
If store.ContainsKey(token) Then
store(token) = value
Else
store.Add(token, value)
End If
Return True
End Function
Public Function Restore(Of T)(ByVal token As String) As T
Dim store = PhoneApplicationService.Current.State
If Not store.ContainsKey(token) Then
Return Nothing
End If
Return CType(store(token), T)
End Function
I call them as follows
Code:
Backup(Me.CheckBox_1.Name, Me.CheckBox_1)
Restore(Of CheckBox)(Me.CheckBox_1.Name)
Don't where is the error, maybe you could take a look and help me out.
Any help is much appreciated!
Where are you calling the Backup and Restore functions? Since your doing page specific things, you could do it in the OnNavigatedFrom and OnNavigatedTo methods, respectively.
keyboardP said:
Where are you calling the Backup and Restore functions? Since your doing page specific things, you could do it in the OnNavigatedFrom and OnNavigatedTo methods, respectively.
Click to expand...
Click to collapse
Hi,
I'm calling them in the OnNavigatedTo and OnNavigatedFrom methods, as you pointed out
Unfortunately, nothing happens at all!
Thanks!
Hi,
As far as I can tell, there's nothing wrong with your saving/loading code. When you call
"Restore(Of CheckBox)(Me.CheckBox_1.Name)", is that returning a bool? You need to assign that bool to the checkbox:
Code:
myCheckbox.IsChecked = Restore(Of CheckBox)(Me.CheckBox_1.Name);
Also, all variables are reset when the page loads, so make sure you have set "myCheckbox.IsChecked" anywhere else on the page that could be called when the page loads.
Please, check the converted code of the above functions, to C#
Code:
public bool Backup(string token, object value)
{
if (null == value)
{
return false;
}
var store = PhoneApplicationService.Current.State;
if (store.ContainsKey(token))
{
store(token) = value;
}
else
{
store.Add(token, value);
}
return true;
}
public T Restore<T>(string token)
{
var store = PhoneApplicationService.Current.State;
if (! (store.ContainsKey(token)))
{
return default(T);
}
return (T)(store(token));
}
Do you think they are OK?
How should I call them ?
Clearly, the restore does not returns a boolean...
Honestly, I'm lost now!
Hope this helps to find the culprit.
It seems okay to me. You'll have to do some debugging. Set a breakpoint inside the Backup and Restore methods. Step through each line and make sure it's going to the line you expect it to and that the value being set is the correct one.
I haven't seen the tombstoning sample from MSDN, but can you get that to work? If so, is the generic method causing the problem? Or can you not get it to work at all?
Hi,
Sorry for the delay in getting back, but I was trying different codes and at least I found the cause.
Code:
Me.NavigationService.Navigate(New Uri("/PivotPage1.xaml?Name=" & "John", UriKind.Relative))
[B]Me.NavigationService.GoBack[/B]()
Me.NavigationService.Navigate(New Uri("/PivotPage1.xaml", UriKind.Relative))
Everything works fine, and the Checkbox state is saved/restored (in the Pivot Page) if I GO BACK using the GoBack hardware button or Me.NavigationService.GoBack
But, the state's dictionary entry is lost or ignored if I go back with the Navigate service (lines 1 and 3)...
Problem is that I need to get back with the query string...
The query string contains a value taken in the SelectedItem event of PAGE2's ListBox, and automatically once retrieved must go back.
I didn't know until know, that NavigationService.Navigate creates a new page instance or something like that in the backstack...
Any sugestions are welcomed!
Hi,
There are various methods you can use depending on the app's architecture. For example, you could have a 'shared' class that contains a shared field that holds the SelectedItem value. When the user selects the item, set the shared field's value and then when you go back, you can get the value from the shared field.
keyboardP said:
Hi,
There are various methods you can use depending on the app's architecture. For example, you could have a 'shared' class that contains a shared field that holds the SelectedItem value. When the user selects the item, set the shared field's value and then when you go back, you can get the value from the shared field.
Click to expand...
Click to collapse
So, no other way to cope with the navigation service?
It's a strange behaviour for sure...
Will try your ideas.
Thanks a lot for your reply!
GFR_2009 said:
So, no other way to cope with the navigation service?
It's a strange behaviour for sure...
Will try your ideas.
Thanks a lot for your reply!
Click to expand...
Click to collapse
There are other ways. For example, instead of using the PhoneApplicationService to store the tombstoning information, you could put it in a querystring for page 2. Then, in page 2, you could add the information from the previous page to a querystring AND the information of the selected item to the querystring. Navigate to page 1, with the querystring that contains information on what was there before and what the user selected. Tombstoning is there for when the user presses the hardware search button, home button, a phone call arrives etc.. It's not there for the navigation of the app. That's where querystrings, shared variables, binary serialization etc... come into play.
The concept of the navigation service is similar to a website. For example, when you submit something and then go back, it might still be there in the page state. However, if you submit something and then reload the previous page by typing it in the address bar, it becomes a completely new page as no state is stored.
keyboardP said:
There are other ways. For example, instead of using the PhoneApplicationService to store the tombstoning information, you could put it in a querystring for page 2. Then, in page 2, you could add the information from the previous page to a querystring AND the information of the selected item to the querystring. Navigate to page 1, with the querystring that contains information on what was there before and what the user selected. Tombstoning is there for when the user presses the hardware search button, home button, a phone call arrives etc.. It's not there for the navigation of the app. That's where querystrings, shared variables, binary serialization etc... come into play.
The concept of the navigation service is similar to a website. For example, when you submit something and then go back, it might still be there in the page state. However, if you submit something and then reload the previous page by typing it in the address bar, it becomes a completely new page as no state is stored.
Click to expand...
Click to collapse
Hi,
Will try your suggested approach, and thanks a lot for the last explanation on how the darn thing works.
Thanks again!
GFR_2009 said:
Hi,
Will try your suggested approach, and thanks a lot for the last explanation on how the darn thing works.
Thanks again!
Click to expand...
Click to collapse
You're welcome . It's one of those things that take a bit of time to understand, but starts to make sense. You might be interested in a free WP7 development ebook by Charles Petzold.
keyboardP said:
You're welcome . It's one of those things that take a bit of time to understand, but starts to make sense. You might be interested in a free WP7 development ebook by Charles Petzold.
Click to expand...
Click to collapse
I already have the book, but will need a deeper reading
So far, I've been testing your idea of using global classes and works ok.
Thanks a lot for being so cooperative, it's much appreciated!
GFR_2009 said:
I already have the book, but will need a deeper reading
So far, I've been testing your idea of using global classes and works ok.
Thanks a lot for being so cooperative, it's much appreciated!
Click to expand...
Click to collapse
No worries! If programming was super easy everyone would be doing it
keyboardP said:
No worries! If programming was super easy everyone would be doing it
Click to expand...
Click to collapse
Never said better!

[Q] Dynamic UI Creation XAML, C#

this is my first post. I am pretty desperate at the moment.
I would like to dynamically create the UI for the WP7 based on a CSV file in Isolated Storage. right now I would settle for just being able to write the UI in XAML from the code behind in C#.
steps that I would like to execute:
1. user clicks a muscle group button which passes a value to another page-done
2. users data is pulled from CSV file and placed in array for easy storage-done
3. for each data element create a XAML TextBlock with the data which is displayed in the UI <-- need some serious help
best I can do is show the XAML code with the <> tags as a string in the UI.
is what I am asking possible?
Thanks for helping.
Knudmt said:
this is my first post. I am pretty desperate at the moment.
I would like to dynamically create the UI for the WP7 based on a CSV file in Isolated Storage. right now I would settle for just being able to write the UI in XAML from the code behind in C#.
steps that I would like to execute:
1. user clicks a muscle group button which passes a value to another page-done
2. users data is pulled from CSV file and placed in array for easy storage-done
3. for each data element create a XAML TextBlock with the data which is displayed in the UI <-- need some serious help
best I can do is show the XAML code with the <> tags as a string in the UI.
is what I am asking possible?
Thanks for helping.
Click to expand...
Click to collapse
Sounds like what you really want to do is dynamically create controls in the code-behind. I would forget about generating "XAML".
Code:
private void AddTextboxesFromCSV(string[] CSVData) {
foreach(string str in CSVData) {
TextBlock tb = new TextBlock();
tb.Name = "txtUserSelectedValue" + CSVData.IndexOf(str);
tb.Text = str;
<YourObject>.Controls.Add(tb);
}
}
Where <YourObject> is the object you want to place the controls into, some sort of layout Panel.
Thanks for the response
I think that is the direction I will be going. Just out of curiosity do you know if what I wanted to do is even possible?
UN app for WP7 does something like this. Go to http://unitednations.codeplex.com/releases/view/57722 and grab the source. Open the source in Visual Studio and browse to the "Framework" folder and open up "BasePage.cs". At the bottom there's a method called AddNavigatingText() that does what I think you are looking to do.
Here's the method:
Code:
protected Grid AddNavigatingText()
{
var NavigatingText = (Grid) XamlReader.Load(
@" <Grid xmlns=""http://schemas.microsoft.com/winfx/2006/xaml/presentation""
xmlns:x=""http://schemas.microsoft.com/winfx/2006/xaml"" Height=""30"" VerticalAlignment=""Top"" Background=""#CCFFFFFF"">
<TextBlock HorizontalAlignment=""Left"" TextWrapping=""Wrap"" Text=""Navigating..."" Width=""129"" FontSize=""{StaticResource PhoneFontSizeNormal}"" Margin=""24,0,0,0"" FontFamily=""{StaticResource PhoneFontFamilySemiBold}""/>
<ProgressBar Style=""{StaticResource PerformanceProgressBar}"" RenderTransformOrigin=""0.5,0.5"" Margin=""135,0,0,0"" UseLayoutRounding=""False"" Background=""White"" IsIndeterminate=""True"" LargeChange=""0"" />
</Grid>");
this.Content.As<Grid>().Children.Add(NavigatingText);
return NavigatingText;
}
Thanks for the reply. Looks pretty simple. I downloaded the source and signed up for codeplex. However I can not connect to the tfs.codeplex.com
It's not possible to use dynamically created XAML; code is the way to go and much easier IMHO.
When you open the project just hit cancel at the login screen and it will load.
sulphuricaciduk said:
It's not possible to use dynamically created XAML; code is the way to go and much easier IMHO.
Click to expand...
Click to collapse
Agreed, doing it via code with a very basic XAML based page is likely to be faster, and will actually work. It's also a lot easier to fix things than trying to work out what went wrong in XAML you can't see...
I would agree with the statement that creating the controls dynamically would be faster. And def a great deal easier to read It just bugs me when I know this can be accomplished, yet I cant get it to work
Blade0rz said:
Sounds like what you really want to do is dynamically create controls in the code-behind. I would forget about generating "XAML".
Code:
private void AddTextboxesFromCSV(string[] CSVData) {
foreach(string str in CSVData) {
TextBlock tb = new TextBlock();
tb.Name = "txtUserSelectedValue" + CSVData.IndexOf(str);
tb.Text = str;
<YourObject>.Controls.Add(tb);
}
}
Where <YourObject> is the object you want to place the controls into, some sort of layout Panel.
Click to expand...
Click to collapse
Well that worked very well, thanks! I am having a little formatting issue .. my textblocks show up right on top of each other. any ideas?
Thanks again
Knudmt said:
Well that worked very well, thanks! I am having a little formatting issue .. my textblocks show up right on top of each other. any ideas?
Thanks again
Click to expand...
Click to collapse
I solved this silly issue. just added a listbox control to the xaml front end and added my elements with an ugly cast
listbox1.items.add((TextBlock)myBlock);
Knudmt said:
I solved this silly issue. just added a listbox control to the xaml front end and added my elements with an ugly cast
listbox1.items.add((TextBlock)myBlock);
Click to expand...
Click to collapse
If you had a StackPanel as the parent control, you could have each new textblock stacked...

[q] xml-rpc & wp7.

In my search to find out a good way (or any way) to post comments on a wordpress article using C# on windowsphone, someone suggested looking into XML-RPC.
Ive done a search & it looks like the right lines, but I have no idea how to actually use it.
Anyone fancy giving me a little example or some sort of push in the right direction about how I can use XML-RPC in my WP7 app.
cris_rowlands said:
In my search to find out a good way (or any way) to post comments on a wordpress article using C# on windowsphone, someone suggested looking into XML-RPC.
Ive done a search & it looks like the right lines, but I have no idea how to actually use it.
Anyone fancy giving me a little example or some sort of push in the right direction about how I can use XML-RPC in my WP7 app.
Click to expand...
Click to collapse
XML-RPC is just reading/writing XML. You could easily just use the built-in Xml classes to build your XML, then use the WebClient to post/receive it from the server. You can use the spec from here to see what XML needs to be generated:
http://www.xmlrpc.com/spec
I don't know of any complete libraries for Windows Phone 7 right now, but you can check this out to get you started:
http://xml-rpc.net/
I've used this silverlight lib called xmlrpc-silverlight. It can be found on google code.
It works perfectly on wp7.
Best regards,
Mateusz
emfor said:
I've used this silverlight lib called xmlrpc-silverlight. It can be found on google code.
It works perfectly on wp7.
Best regards,
Mateusz
Click to expand...
Click to collapse
This will come in handy for one of my projects also, thanks for this!
emfor said:
I've used this silverlight lib called xmlrpc-silverlight. It can be found on google code.
It works perfectly on wp7.
Best regards,
Mateusz
Click to expand...
Click to collapse
Thanks
I found this here: http://code.google.com/p/xmlrpc-silverlight/
But it doesnt seem to have any downloads or code to actually use
Dont suppose you have a copy of it still?
I have too few posts... On the page, go to "Source" tab, than "Browse" and in the "trunk" folder there is file XmlRpc.cs - that's it!
Best regards,
Mateusz
thank you thank you thank you
Found it! Now Im gonna play with it a bit & see if I can get this working ;D
Well, Ive played with it a bit & I think I understand some of it, but I really have never used XML-RPC before & cant get it to work
Any chance you could give me a hint as to how I could post a comment to (for example) this page: http://www.1800pocketpc.com/2011/02/03/fireworks-an-amazing-free-app-for-windows-phone-7.html
Its just a random post from the site Im creating the app for.
On the wordpress page about XML-RPC it says this:
wp.newComment
Create new comment.
If you want to send anonymous comments, leave the second and third parameter blank.
Parameters
■ int blog_id
■ string username
■ string password
■ int post_id
■ struct comment ■ int comment_parent
■ string content
■ string author
■ string author_url
■ string author_email
Return Values
■ int comment_id
Click to expand...
Click to collapse
Sadly Im not quite sure what to do with that. Plus I havent a clue what the "blog_id" or "post_id" would be :/
Ive been coding for 4 years & I still feel like a total newbie half the time >_<
I think something like that shoud work:
Code:
XmlRpcService service = new XmlRpcService("Url_to_the_service");
XmlRpcRequest req = new XmlRpcRequest(service, "wp.NewComment", new object[] {
1,
"UserName",
"Pass",
1,
?,
1,
...
});
req.XmlRpcCallCompleteHandler
+= new XmlRpcCallComplete(req_XmlRpcCallCompleteHandler);
req.Execute(null);
generally this should work. There is an struct element, so you should implement this struct in C# and pass it there...
I don't know WP so i can't help with parameters meaninig...
Good luck!
Best regards,
Mateusz

Hooking hardware buttons

Hi,
Does anyone know of a thread/post including sample code of an XPosed module, explaining how to hook hardware buttons?
A tutorial would be great, but I guess my search skills are rather poor, I can't seem to find one.
If there isn't anything, then I guess I'll try to understand the source code here :
github.com/agentdr8/GoogleCamX/blob/master/src/com/dr8/xposed/gcx/Mod.java
but if there is anything you can point me to, please help!
Thanks.
binhexcraft said:
Hi,
Does anyone know of a thread/post including sample code of an XPosed module, explaining how to hook hardware buttons?
A tutorial would be great, but I guess my search skills are rather poor, I can't seem to find one.
If there isn't anything, then I guess I'll try to understand the source code here :
github.com/agentdr8/GoogleCamX/blob/master/src/com/dr8/xposed/gcx/Mod.java
but if there is anything you can point me to, please help!
Click to expand...
Click to collapse
That module isn't hooking the buttons directly, but the methods in which the keyCode int is being analyzed. Which button(s) are you after and in which scenario(s)?
agentdr8 said:
That module isn't hooking the buttons directly, but the methods in which the keyCode int is being analyzed. Which button(s) are you after and in which scenario(s)?
Click to expand...
Click to collapse
Any button would be okay, home button, volume up/down, power button, any one of them would suffice.
It would suffice if I could specifically hook one of those buttons and execute my own android code within a certain application context, but if it's not possible, then a global hook for one of the keys for all applications would also be nice.
I read the source code last night and yeah you're right. It hooks certain functions that in turn processes the keyCodes. I'm looking for a more general way to hook the buttons regardless of functions that already exist in the application which analyze the buttons pressed(which the above module uses). What if such function doesn't exist? What would I have to hook in order to intercept hardware key input?
Any suggestions?
binhexcraft said:
What if such function doesn't exist? What would I have to hook in order to intercept hardware key input?
Click to expand...
Click to collapse
Look at the source for framework.jar and android-policy.jar. There's a few places there to grab hardware keys globally.
But if you're only interested in a specific app context, I'd go through that app's code to see if there are any key event methods you can hook into. Might be easier.
agentdr8 said:
Look at the source for framework.jar and android-policy.jar. There's a few places there to grab hardware keys globally.
But if you're only interested in a specific app context, I'd go through that app's code to see if there are any key event methods you can hook into. Might be easier.
Click to expand...
Click to collapse
The application is heavily obfuscated with DexGuard, so it's kind of hard to find the right place to hook into.
By the way, is it even possible to hook into DexGuarded application functions? Cause the package, class, method names are all distorted into weird Unicode characters that don't even display correctly when opened in notepad. I'm not sure if XPosed can properly handle non ascii, wierd unicode symbols... is it possible?
But yeah, I'll look into framework.jar and android-policy.jar. If I were to hook a function in those, then I would have to hook the "android" application right?
Thanks.
binhexcraft said:
The application is heavily obfuscated with DexGuard, so it's kind of hard to find the right place to hook into.
By the way, is it even possible to hook into DexGuarded application functions? Cause the package, class, method names are all distorted into weird Unicode characters that don't even display correctly when opened in notepad. I'm not sure if XPosed can properly handle non ascii, wierd unicode symbols... is it possible?
But yeah, I'll look into framework.jar and android-policy.jar. If I were to hook a function in those, then I would have to hook the "android" application right?
Click to expand...
Click to collapse
You should be able to hook obfuscated methods the same. I'm not sure I've run across a DexGuarded app yet, but those with ProGuard have methods in classes like a.b.c.dd() and they work with Xposed, assuming you can figure out where you need to hook.
I believe "com.android.internal" is where you'd want to look for framework classes/methods.
I found what I am looking for!
http://forum.xda-developers.com/xposed/modules/app-home-volume-button-t2637235
https://github.com/rovo89/XposedMod...xposed/mods/tweakbox/VolumeKeysSkipTrack.java
https://github.com/MohammadAG/Xpose...m/mohammadag/enablecardock/EnableCarDock.java
Thanks for your help.
this how I hooked home button!
findAndHookMethod("android.view.View", lpparam.classLoader, "onKeyDown", int.class, KeyEvent.class, new XC_MethodHook() {
@override
protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
KeyEvent keyEvent = (KeyEvent) param.args[1];
if (keyEvent.getAction() != KeyEvent.KEYCODE_HOME || keyEvent.getAction() != KeyEvent.KEYCODE_BACK)
....;
}
});
i have the same problem...trying again standby
Forgive the necro but this seems like the most relevant thread for what I'm looking for.
With xposed edge not being updated for a13 and pbmc not working either I'm looking to write my own simple app to intercept volume down key presses so i can make double tap toggle the flashlight.
I've found a few examples of hooks but nothing has worked for a13, I would appreciate some insight into where to hook.

[MTCD/E/P] Radio app reverse engineered

Hey,
I created my own Lauchner and wanted to integrate the radio functions.
Since I didn't find any information on the internet about how the original app addresses the radio module, I reverse engineered the app.
To make it easier for others I decided to start an Android Studio project.
The project is only very basic to show how the radio module is controlled.
I also added an extension to it.
Using the RDS signal and a SQlite database the station name and logo are displayed.
I hope it is helpful to anyone.
I uploaded the project to Github:
-https://github.com/zebbel/MTCD-E_Radio-app
(Sorry I´m not allowed to post links)
Kind regards
David
Great work!
Hey,
I have compiled the CarManager module into a jar file for easier use in Android Studio projects.
To be honest I never tried to understand how it works exactly, because it just works :laugh:
I know that I downloaded the files somewhere on Github, but I have absolutely no idea where.
If the "creator" of the files is here please let me know so I can give him credit.
-https://github.com/zebbel/microntek_CarManager
(I need still more posts to create links )
Thank you very much for your work!
Thanks to your library I realized a widget that reads (and shows) the battery voltage value.
I have a question : do you have a complete list of "type" that can be used ?
In you example you attached to your handler the types:
- Radio
- KeyDown
In my case I used "CarEvent" :
Java:
CarManager carManager = new CarManager();
CarManagerHandler carManagerHander = new CarManagerHandler(this);
carManager.attach(carManagerHander, "CarEvent");
In this way my Handler is receiving all the CarEvents. The voltage is contained in the message tagged as "battery".
There are other types that we can use in order to catch other interesting events?
Thank you,
Salvo

Categories

Resources