Hi all,
i just played a bit with the GSesnor SDK and i got a nice idea for a good extension to the Diamond:
An application which lets you scroll up/down through lists by tilting your diamond.
I got a little Test app working with the GSensor SDK, but i couldn't figure out yet how to bring windows mobile to scroll up or down in the active control.
Does anyone have an idea for this?
Btw: i am using C#/Compact Framework 3.5
I think this would be a great thing for the diamond since i do not realy like scrolling though lists with my fingers/pencil...
Thanks for any help and suggestions!
Little late to the Party Juniaaaaa LINK
Sergio PC said:
Little late to the Party Juniaaaaa LINK
Click to expand...
Click to collapse
Thanks for the Info.
But as AFAIK there is also just the idea for it but also no solution.
So still:
If anyone know an hint for my question i will be very grateful.
Using unmanaged keybd_event function you can send up and down keystrokes to the the active window.
VOID keybd_event( BYTE bVk,
BYTE bScan,
DWORD dwFlags,
DWORD dwExtraInfo
);
[DllImport("coredll")]
extern static void keybd_event(byte virtualKey, byte scanCode, uint flags, uint extraInfo);
You'll need to look up the virtual key code values, and the value of KEYEVENTF_KEYUP to make it work. Just create an unmanaged smart device project and set the values to a variable that you can inspect...
My Diamond shows a GPS altitude offset of about 50 m plus to actual hight. I´ve tried different GPS applications and also cleared GPS memory without any success.
Is there a possibility to correct the offset?
Do other users face similar problems?
I believe the HTC touch diamond has a well known GPS issue... It's always 50m wrong, either in directions via GPS software of regarding altitude...
This is the divergence of the real world (geoide) from the idealized ellipsoidal model that the GPS system uses. Some GPS receivers have an internal data table with correction values for this offset. But our beloved internal GPS doesn't seem to have such.
The offset here in Germany (and probably in Swizerland) is about 42 meters lower.
Some programs do allow to enter a manual offset. Pathaway for example. IGo and TomTom don't.
Thanks for the tip, geoide was exactly the right keyword. I´ve now found more details in internet about it and even my software (noniGps) is able to correct it
TheOnlyDidi said:
Thanks for the tip, geoide was exactly the right keyword. I´ve now found more details in internet about it and even my software (noniGps) is able to correct it
Click to expand...
Click to collapse
Please divulge on how you did it?
Regards,
Will
With noniGPS you can specify a Geoide correction at Advanced Setup/GPS. Note that you have to suppress "Upd auto" (same setup page) otherwise the software ignores the correction. More details here >>
http://aeguerre.free.fr/Public/PocketPC/NoniGPSPlot/EN/menu.php#M62
Nasty thing is that the software has to correct the offset and that I have to adapt the correction manually depending my current location.
Calculation can be done here >>
http://earth-info.nga.mil/GandG/wgs84/gravitymod/wgs84_180/intptW.html?
I'm not a GPS expert but shouldn't the GPS HW and/or driver do this correction automatically? At least my car GPS is able to give the right altitude without manual intervention.
So let me raise the question again:
Is there a possibility to do the GEOID correction within HTC Diamond for all GPS application (e.g. Tom Tom) ???
I need to implement a broadcast reciever that will fill variables for the methods my module will hook up.
But every thing that I tried out didnt work.
I tried to implement the reciever in the module class:
public class LogginExtra extends BroadcastReceiver implements IXposedHookLoadPackage {
But it says ClassNotFound.
Tried to make something with sharedPreferences, but the XSharedPreferences doesnt reads the prefs.
And I dont know how to solve this, if someone can help me I need to update 2 variables at the Module class (IXposedHookLoadPackage) from a broadcast reciever.
thanks in advanced.
caioketo said:
I need to implement a broadcast reciever that will fill variables for the methods my module will hook up.
But every thing that I tried out didnt work.
I tried to implement the reciever in the module class:
public class LogginExtra extends BroadcastReceiver implements IXposedHookLoadPackage {
But it says ClassNotFound.
Tried to make something with sharedPreferences, but the XSharedPreferences doesnt reads the prefs.
And I dont know how to solve this, if someone can help me I need to update 2 variables at the Module class (IXposedHookLoadPackage) from a broadcast reciever.
thanks in advanced.
Click to expand...
Click to collapse
The key to the solution is to realize the core of the module (the Xposed hooks) is not an application in itself. Instead its code runs as part of another application or as part of an Android system component. This is why XSharedPreferences is called 'shared'.
It depends on what your module is doing and when/where/how the code of you module runs, which solution is best.
Note that using XSharedPreferences isn't the holy grail either, as this solution might stop working in Android "L", because of new SELinux rules (which could affect quite some modules).
M66B said:
The key to the solution is to realize the core of the module (the Xposed hooks) is not an application in itself. Instead its code runs as part of another application or as part of an Android system component. This is why XSharedPreferences is called 'shared'.
It depends on what your module is doing and when/where/how the code of you module runs, which solution is best.
Note that using XSharedPreferences isn't the holy grail either, as this solution might stop working in Android "L", because of new SELinux rules (which could affect quite some modules).
Click to expand...
Click to collapse
Basically my module hook an Intent method, but I need a way to pass for the module the package name that it should look, and the package Ill get in a broadcast reciever, so, how can I pass a simple String variable for the module?? I understand what you said but still no clue to how to pass a variable from a reciever to the module itself.
caioketo said:
Basically my module hook an Intent method, but I need a way to pass for the module the package name that it should look, and the package Ill get in a broadcast reciever, so, how can I pass a simple String variable for the module?? I understand what you said but still no clue to how to pass a variable from a reciever to the module itself.
Click to expand...
Click to collapse
You can hook Intents at different places, which makes a difference, since this could be either within an application or within an Android component. Hooking within an application makes this simpler, since you will probably be able to use the application context to communicate.
Basically you can use some form of shared storage to pass information (which is what XSharedPreferences does) or inter process calls. Example of IPCs are intents and services, both if which require a proper Context instance to work.
The bottom line is that you first need to understand from where to where you need to communicate.
I am aware that I am not very concrete about what to do. You could take a look at the implementation of XSharedPreferences, which isn't very difficult to understand, or how for example XPrivacy does this, which is more difficult to understand: https://github.com/M66B/XPrivacy (basically the PrivacyManager class is used to fetch settings from a service implemented in PrivacyService class and running within Android).
But what you said about the XSharedPreferences, that it could possible stop working on L, makes me not wanting to use it, so here is my hook code:
findAndHookMethod("android.os.Bundle", loadPackageParam.classLoader, "getString", String.class, new XC_MethodHook() {
@override
protected void afterHookedMethod(MethodHookParam param) throws Throwable {
if (getExtra(loadParam.packageName)) {
String key = (String) param.args[0];
String value = (String) param.getResult();
getExtrasToSend().putString(key, value);
}
}
});
Basically it will grab every call to getExtras, of all packages, and when it get called it should check if the package that called, is the one I'm looking for (from the reciever part), I got 2 ideas, first one I'm testing right now, is I get a class wich holds a static field and method to the packageName variable, and I'm calling it with: (String)XposedHelpers.callMethod(Util.class, "getPackageName", null);
probably wont work, and I was thinking about hooking the method of my own reciever to get the variable in the module class, and use as static variable there.
Any of these should work? Is there a better way to make it??
caioketo said:
But what you said about the XSharedPreferences, that it could possible stop working on L, makes me not wanting to use it, so here is my hook code:
findAndHookMethod("android.os.Bundle", loadPackageParam.classLoader, "getString", String.class, new XC_MethodHook() {
@override
protected void afterHookedMethod(MethodHookParam param) throws Throwable {
if (getExtra(loadParam.packageName)) {
String key = (String) param.args[0];
String value = (String) param.getResult();
getExtrasToSend().putString(key, value);
}
}
});
Basically it will grab every call to getExtras, of all packages, and when it get called it should check if the package that called, is the one I'm looking for (from the reciever part), I got 2 ideas, first one I'm testing right now, is I get a class wich holds a static field and method to the packageName variable, and I'm calling it with: (String)XposedHelpers.callMethod(Util.class, "getPackageName", null);
probably wont work, and I was thinking about hooking the method of my own reciever to get the variable in the module class, and use as static variable there.
Any of these should work? Is there a better way to make it??
Click to expand...
Click to collapse
Static variables probably won't work, since the settings holder and the settings user probably run in different process spaces. You need either some kind of shared storage or an IPC mechanism to communicate the settings.
Is it possible to use files for that? or database? Im really lost, never work with that yet, and seems that there isnt any explanations on google.
caioketo said:
Is it possible to use files for that? or database? Im really lost, never work with that yet, and seems that there isnt any explanations on google.
Click to expand...
Click to collapse
Shared preferences does use an XML file, so yes. A database is possible too, but you need to make sure both the settings manager and the hook do have access to it, same as with using (XML) files. You'll need to take care of locking too, since multiple process will access the file or database.
M66B said:
Shared preferences does use an XML file, so yes. A database is possible too, but you need to make sure both the settings manager and the hook do have access to it, same as with using (XML) files. You'll need to take care of locking too, since multiple process will access the file or database.
Click to expand...
Click to collapse
I have broadcast receivers in my settings activity and my xposed module so they can communicate with each other. You need to setup your receiver in the xposed side programatically:
Code:
Context context = (Context)XposedHelpers.getObjectField(param.thisObject, "mContext");
IntentFilter filter = new IntentFilter();
filter.addAction(XposedReceiver.RESET_ACTION);
filter.addAction(XposedReceiver.REFRESH_ACTION);
context.registerReceiver(mBroadcastReceiver, filter);
The problem is that I'm hooking the Intent class, and it dont have a context field for me to register the broadcast.
EDIT: I don't think Im being clear of what I need, I need to be able to set someway to send the package name to the module, I'll hook this methods:
findAndHookMethod("android.os.Bundle", loadPackageParam.classLoader, "getString", String.class, new XC_MethodHook() { @override
protected void afterHookedMethod(MethodHookParam param) throws Throwable {
if (loadParam.packageName.equals(PACKAGE_NAME_FROM_BROADCAST) {
String key = (String) param.args[0];
String value = (String) param.getResult();
getExtrasToSend().putString(key, value);
}
}
});
and I need to pass that PACKAGE_NAME_FROM_BROADCAST from a broadcast receiver, dont know the way to make it, tried static variables, xsharedpreferences, etc.
Cant get it working. and I dont know more what to try.
caioketo said:
The problem is that I'm hooking the Intent class, and it dont have a context field for me to register the broadcast.
EDIT: I don't think Im being clear of what I need, I need to be able to set someway to send the package name to the module, I'll hook this methods:
Code:
findAndHookMethod("android.os.Bundle", loadPackageParam.classLoader, "getString", String.class, new XC_MethodHook() {
@override
protected void afterHookedMethod(MethodHookParam param) throws Throwable {
if (getExtra(loadParam.packageName)) {
String key = (String) param.args[0];
String value = (String) param.getResult();
getExtrasToSend().putString(key, value);
}
}
});
and I need to pass that PACKAGE_NAME_FROM_BROADCAST from a broadcast receiver, dont know the way to make it, tried static variables, xsharedpreferences, etc.
Cant get it working. and I dont know more what to try.
Click to expand...
Click to collapse
First of all it is not a good idea to hook into android.os.Bundle, since this will impact the system performance significantly.
Moreover android.os.Bundle is used very frequently in applications and various Android components, meaning your hook will run in a variety of process spaces. Getting a Context in this Xposed hook will therefore often not be possible. If you really want to go this way, a service directly registered with the service manager is your only option, but my advice is to find another, less intrusive, way to do what you want.
Ok, the problem is that, my module needs to grabs all calls to "getExtras" ("getStringExtra", "getBooleanExtra", etc) to know all extras that the application will expect, than I'll pass it to AutoShare app, so you can customize and start an intent with all possible extras.
Is there any other way to grab the extras without hooking the Bundle or Intent? About the perform, its doing nothing if its without the right package, so will it still slow the performance???
Thanks for the repply.
caioketo said:
...
About the perform, its doing nothing if its without the right package, so will it still slow the performance???
Thanks for the repply.
Click to expand...
Click to collapse
A hook never does nothing, since there will always be code executed. The hook you are trying to use will be executed really a lot, so there will be significant performance problem.
The 'bundle' is a general 'message', which is used for a lot of things. You should find a way not to hook into the 'bundle', but into a higher level function.
Hello,
I'm using Sygic Navigation for Android. Now I'm trying to get some data out of Sygic to use in Tasker. For example I want to get my Estimated Time of Arrival (ETA) and save it as a variable in Tasker. Sygic offers a SDK, see "developers [dot] sygic [dot] com [slash] documentation.php?action=code_geteta" (sorry, first post, not allowed to post URLs), so I guess there are possibilities with Tasker....??
The thing is, I'm really new to programming and have no idea how to start / what to do with the Java possibilities in Tasker
Is there anyone who can help me "translate" the Java code below to some Java code that I can use in Tasker? Or is this not possible at all?
Code:
import com.sygic.sdk.remoteapi.Api;
import com.sygic.sdk.remoteapi.ApiNavigation;
import com.sygic.sdk.remoteapi.model.RouteInfo;
...
String strETA = "";
try {
RouteInfo info = ApiNavigation.getRouteInfo(false, 0);
RouteInfo.RouteInfoTime eta = info.getEstimatedTimeArrival();
strETA = String.valueOf(eta);
} catch (GeneralException e) {
Log.e("RouteInfo", "Error code:"+ e.getCode());
}
Thanks!
Vic
I would not go the SDK / Java route unless you have some Java programming skills already.
In your case, try to investigate Autonotification and AutoInput which are two very popular Tasker plugins.
You can find some similar examples (I actually do it with Maps) on the AutoApps forum.
It won't work at all in Tasker unless you write a completely new plugin. How can you use Sygic SDK in Tasker?? I don't think it's possible. If the information is in the notification you can use Notification Listener to get the notification in the task and read it. If it's only on the screen you can read it using the action "read screen" of TouchTask plugin.