[Q] is available getting POWER PROFILE in Galaxy series? - Android Q&A, Help & Troubleshooting

first, i'm poor at English. i apologize.
Code:
import android.os.BatteryManager;
import android.os.ServiceManager;
import android.content.Context;
BatteryManager mBatteryManager = (BatteryManager)Context.getSystemService(Context.BATTERY_SERVICE);
Long energy = mBatteryManager.getLongProperty(BatteryManager.BATTERY_PROPERTY_ENERGY_COUNTER);
Log.i(TAG, "Remaining energy = " + energy + "nWh");
i want to know that API(Power Profiles in Android) is available in Samsung Galaxy Series.
(i attached link, but my level is low, so i don't that... :crying
that API is saying that NEXUS series is available. but i don't know Galaxy Seires..
i have NEXUS 5, but it's not works.
i hope your answer.
thnx!

Hello hiddenparts,
It depends on the battery fuel gauge. Some of them support different properties like the remaining energy. According to this "source.android. com/devices/tech/power/device. html" Nexus 5 doesn't provides what you are asking for. There is another solution that might works for your case. Check /sys/calss/power_supply/battery directory on your device. There are several files, you may find charge_counter file that contains the current value of the remaining energy. Anyway, these files represent the battery stats.
good luck.

Related

[Q] Best way to receive gps state change for enabled/disabled

Hi,
is there a better way to receive ONLY the enabled/disabled state change for GPS
than go with LocationListener ? I have read, the LocationListener needs some
battery life, which is some useless if so.
Is there really no action / intent to receive for or i'm blind to find that in documentation?
thanks for help
Andy
I'm in the process of testing an app that uses LocationManager.
First, take a look at the Criteria class. Here you can provide some settings, one of which is "setPowerRequirement". This can help with battery life.
Next is the call to "requestLocationUpdates" which includes a time and distance. Time is in milliseconds, distance in meters. The developer guide suggests setting time to no lower than one minute to conserve battery.
I've run this for about 3 hours on the road and the battery use for my app seems fine; it's not sucking the life out of the battery. Maybe I'll go against the developer guide and set it to one second, 10 feet and go for a drive (see my "final" note LOL) and see what that does to the battery.
Found this little snippet that may be of use to you:
Code:
GpsStatus.Listener gpsListener = new GpsStatus.Listener() {
public void onGpsStatusChanged(int event) {
if( event == GpsStatus.GPS_EVENT_FIRST_FIX){
showMessageDialog("GPS fixed");
}
}
};
Finally, a note about writing a LocationManager app...THEY'RE A ***** TO TEST!! ROFL
Rootstonian said:
I'm in the process of testing an app that uses LocationManager.
First, take a look at the Criteria class. Here you can provide some settings, one of which is "setPowerRequirement". This can help with battery life.
Next is the call to "requestLocationUpdates" which includes a time and distance. Time is in milliseconds, distance in meters. The developer guide suggests setting time to no lower than one minute to conserve battery.
I've run this for about 3 hours on the road and the battery use for my app seems fine; it's not sucking the life out of the battery. Maybe I'll go against the developer guide and set it to one second, 10 feet and go for a drive (see my "final" note LOL) and see what that does to the battery.
Found this little snippet that may be of use to you:
Code:
GpsStatus.Listener gpsListener = new GpsStatus.Listener() {
public void onGpsStatusChanged(int event) {
if( event == GpsStatus.GPS_EVENT_FIRST_FIX){
showMessageDialog("GPS fixed");
}
}
};
Finally, a note about writing a LocationManager app...THEY'RE A ***** TO TEST!! ROFL
Click to expand...
Click to collapse
thanks for answer,
i've seen these code on stackoverflow already, but it means more the fixed GPS position optimization to save battery power
I only need the events when gps is enabled or disabled, not more
I would use the code above and then call:
public static final int GPS_EVENT_SATELLITE_STATUS
Since: API Level 3
Event sent periodically to report GPS satellite status. Call getSatellites() to retrieve the status for each satellite.
Constant Value: 4 (0x00000004)

Best practice for storing configurations

Hello everyone,
I'm new to Android development. I've written my first little "get my feet wet" ap and am looking to expand on it. One thing I would like to do it give the user more options of things they can configure and I'm wondering about the best way to store that information.
At what point does it become worthwhile to start using mySQL vs just using string data in the prefrences? Or is there another option I've missed (maybe an xml file, but I'm not sure where that would be stored?).
In my case, I'm thinking I have fewer than 100 instances of an object (or objects) that would have 3 or 4 properties associated with them.
Thanks!
Use the SharedPreferences class, is the easiest way to achieve your goal (BTW, SharedPreferences generate a xml file to storing your preferences).
SharedPrefrences is what I used for my basic version, but my understanding is that it allows for name-value pairs right? That works well when you have a predetermined set of prefrences, but what if it's more fluid?
Say I want to allow the user to configure his widgits, and each widget has a number of properties - say "color", "number", and "size". Maybe one user will configure 3 widgets and another user might configure 25.
I can think of a couple of different ways to parse this out into name-value pairs, but is that the best way?
Yep... for me that is the best way. For each user you can put the values using someting like this:
UserName+WidgetID+"PreferenceName"
And thats all... the preferences will be unique for each case, without parsing and 0 errors
Ok, cool. That's one of the options I had considered but didn't know if that would be the most efficient. Of course I'd also have to have a list of all the "Widget ID's" stored in a preference to loop through as well.
I assume the maximum amount of data that can be stored in one prefrence is just whatever the Java max string length is...is that correct?
Yes, you're right

Fix kitkat SMS MAP (bluetooth) originator

I've found that bluetooth SMS messaging doesn't interact too well with some car head units. In particular, Chrysler/Dodge/Jeep "uconnect" systems have issues understanding SMS originators with many kitkat phones. The reason is simple: "uconnect" (and other head units, I suppose) expect bluetooth map "vcards" to have an originator phone number in a raw (unformatted) format, while AOSP kitkat puts in pretty formatted phone numbers.
Good: +12345678901
Bad: (234) 567-8901
This module resolves that little issue.
...and here's the xposed repo link: http://repo.xposed.info/module/org.garyndenise.xposed.btsmsmapfix
As for source, I just whipped this up in eclipse in windows, and I never bothered getting git working properly in windows... (I suppose I could copy this to one of my linux boxes, but I'm really too lazy.) So, I'll just paste the source below.
Licensing is simple: The method I'm replacing (and somewhat duplicating) is copyrighted by Samsung and licensed under Apache. (Standard AOSP licensing.) My modifications are PUBLIC DOMAIN, or the least restrictive possible license that is compatible with Samsung's copyright and the Apache License.
Don't expect too much support on this. I wrote it to fix an issue for my wife with her LG G2, and it just so happens that LG is using the AOSP MAP code pretty much intact. She's happy, so I consider my support contract fulfilled.
I've tested this on the G2, but not on anything running AOSP.
Code:
/* Copyrights...
*
* Portions of this file are taken from AOSP with the following copyright notice:
*
* Copyright (C) 2013 Samsung System LSI
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* The remainder of the source is released to the PUBLIC DOMAIN or to the
* least restrictive licensing allowable in order to co-exist with the
* above mentioned license.
*
*/
package org.garyndenise.xposed.btsmsmapfix;
import android.content.ContentResolver;
import android.database.Cursor;
import android.net.Uri;
import android.provider.ContactsContract;
import android.provider.ContactsContract.Contacts;
import android.provider.ContactsContract.PhoneLookup;
import de.robv.android.xposed.IXposedHookLoadPackage;
import de.robv.android.xposed.XC_MethodReplacement;
import de.robv.android.xposed.XposedBridge;
import de.robv.android.xposed.XposedHelpers;
import de.robv.android.xposed.XposedHelpers.ClassNotFoundError;
import de.robv.android.xposed.callbacks.XC_LoadPackage.LoadPackageParam;
import static de.robv.android.xposed.XposedHelpers.findAndHookMethod;
public class BTSmsMapFix implements IXposedHookLoadPackage {
public void handleLoadPackage(final LoadPackageParam lpparam) throws Throwable {
if (!lpparam.packageName.equals("com.android.bluetooth"))
return;
/*
* When bluetooth in kitkat AOSP (and LG, apparently) attempts to
* create a vCard for inclusion in a MAP bMessage, it's using the
* version 3 vcard, and supplying pretty-formatted phone numbers. For
* some MAP clients (car head units), this isn't a problem. However
* some head units (such as Chrysler "uconnect" systems) insist on
* having the phone number in raw SMS format (such as +1xxxyyyzzzz in
* the USA) and not in a more local "(xxx) yyy-zzzz" format.
*
* Intercept and replace the method used by android's BT to create a
* vCard from a phone number so that if it's an incoming vCard, use
* the older 2.1 version, and instead of pulling in all the phone
* numbers and emails for the contact, just stick the raw originator
* phone number (unformatted) into the vcard with a name.
*
*/
try {
Class<?> CBluetoothMapbMessage = XposedHelpers.findClass("com.android.bluetooth.map.BluetoothMapbMessage", lpparam.classLoader);
try {
findAndHookMethod("com.android.bluetooth.map.BluetoothMapContent",
lpparam.classLoader,
"setVCardFromPhoneNumber",
CBluetoothMapbMessage,
String.class,
boolean.class,
new XC_MethodReplacement() {
/*
* Most of the replaced method is identical to the original in
* AOSP, with the exception of if the 'incoming' flag is true.
* In that case, set the only phone number for the card as
* whatever was passed in, and leave the vcard in 2.1 format
*/
@Override
protected Object replaceHookedMethod(MethodHookParam param)
throws Throwable {
String contactId = null, contactName = null;
String[] phoneNumbers = null;
String[] emailAddresses = null;
Cursor p;
String phone = (String)param.args[1];
boolean incoming = (boolean)param.args[2];
ContentResolver mResolver = (ContentResolver) XposedHelpers.getObjectField(param.thisObject, "mResolver");
Uri uri = Uri.withAppendedPath(PhoneLookup.CONTENT_FILTER_URI,
Uri.encode(phone));
String[] projection = {Contacts._ID, Contacts.DISPLAY_NAME};
String selection = Contacts.IN_VISIBLE_GROUP + "=1";
String orderBy = Contacts._ID + " ASC";
// Get the contact _ID and name
p = mResolver.query(uri, projection, selection, null, orderBy);
if (p != null && p.getCount() >= 1) {
p.moveToFirst();
contactId = p.getString(p.getColumnIndex(Contacts._ID));
contactName = p.getString(p.getColumnIndex(Contacts.DISPLAY_NAME));
}
p.close();
// Bail out if we are unable to find a contact, based on the phone number
if (incoming || (contactId == null)) {
phoneNumbers = new String[1];
phoneNumbers[0] = phone;
XposedHelpers.callMethod(param.args[0], "addOriginator", contactName, phoneNumbers, emailAddresses);
} else {
// Fetch all contact phone numbers
p = mResolver.query(ContactsContract.CommonDataKinds.Phone.CONTENT_URI, null,
ContactsContract.CommonDataKinds.Phone.CONTACT_ID + " = ?",
new String[]{contactId},
null);
if(p != null) {
int i = 0;
phoneNumbers = new String[p.getCount()];
while (p != null && p.moveToNext()) {
String number = p.getString(
p.getColumnIndex(ContactsContract.CommonDataKinds.Phone.NUMBER));
phoneNumbers[i++] = number;
}
p.close();
}
// Fetch contact e-mail addresses
p = mResolver.query(ContactsContract.CommonDataKinds.Email.CONTENT_URI, null,
ContactsContract.CommonDataKinds.Phone.CONTACT_ID + " = ?",
new String[]{contactId},
null);
if(p != null) {
int i = 0;
emailAddresses = new String[p.getCount()];
while (p != null && p.moveToNext()) {
String emailAddress = p.getString(
p.getColumnIndex(ContactsContract.CommonDataKinds.Email.ADDRESS));
emailAddresses[i++] = emailAddress;
}
p.close();
}
XposedHelpers.callMethod(param.args[0], "addRecipient", contactName, contactName, phoneNumbers, emailAddresses); // Use version 3.0 as we only have a formatted name
}
return null;
}
});
} catch (NoSuchMethodError e) {
XposedBridge.log("ERROR: Unable to find method com.android.bluetooth.map.BluetoothMapContent.setVCardFromPhoneNumber");
}
} catch (ClassNotFoundError e) {
XposedBridge.log("ERROR: unable to find class com.android.bluetooth.map.BluetoothMapbMessage");
}
}
}
Edit: This bug has been submitted to google as https://code.google.com/p/android/issues/detail?id=70160. I'd submit a full fix to them in gerrit, but I really don't want to see it ignored by google for 2 years, and then marked as "won't merge", "already fixed" or somehow ignored. Again.
As I mentioned, I wasn't able to test it on any kitkat device that is AOSP or AOSP based (cyanogenmod, omnirom, etc), so I'd appreciate any feedback on if it works on those. (For AOSP, the specific device is less important than the specific firmware name and version.)
thanks
Gary
Hi!
I tried this on my Sony z1 running 4.4.2 in the hope that it would fix the bluetooth issue that I have with my car audio system.. In that it pairs of and I get the call logs bit it will not download the phonebook to the car audio.. I tried it but it did not work.. Oh well thanks for the module anyway... Is there anything that you could suggest that could resolve this?
Regards,
Alan
nalab1 said:
In that it pairs of and I get the call logs bit it will not download the phonebook to the car audio..
Click to expand...
Click to collapse
This module could only fix the specific situation I described in the original post. The MAP code is very isolated from the phonebook code...
Not sure if there's anything I can suggest to resolve the problem your having...
Take care and good luck...
Gary
Sent from my HTC One_M8
Uconnect Fix
Does this fix the problems with only AOSP, or will it work on stock rooted devices as well? I have a 2012 Dodge with the 430N RHB. I've had messaging problems and "phone call completed" error since the 4.4.2 update. I appreciate the code, and I'm sure many others will find this post helpful as well.
garyd9 said:
This module could only fix the specific situation I described in the original post. The MAP code is very isolated from the phonebook code...
Not sure if there's anything I can suggest to resolve the problem your having...
Take care and good luck...
Gary
Sent from my HTC One_M8
Click to expand...
Click to collapse
Hi Gary,
Thanks for your reply. Shame it didn't fix my problem.. It was worth a try though, as I have tried lots of things and nothing seems to work... ts strange that Google screwed it up in 4.4.2 when it was working perfectly in 4.2.2... Perhaps the developers ought to try regression testing their code....
Regards,
Alan
nalab1 said:
strange that Google screwed it up in 4.4.2 when it was working perfectly in 4.2.2... Perhaps the developers ought to try regression testing their code....
Click to expand...
Click to collapse
Unless your using pure AOSP on your device, you can't assume that it was Google that broke it. In fact, with bluetooth code, it appears that many non-nexus (and non-AOSP) devices are running code very dissimilar to AOSP in kitkat. I was actually surprised to see that the LG G2's bluetooth module was extremely similar to AOSP.
Take care
Gary
garyd9 said:
This module could only fix the specific situation I described in the original post. The MAP code is very isolated from the phonebook code...
Not sure if there's anything I can suggest to resolve the problem your having...
Take care and good luck...
Gary
Sent from my HTC One_M8
Click to expand...
Click to collapse
garyd9 said:
Unless your using pure AOSP on your device, you can't assume that it was Google that broke it. In fact, with bluetooth code, it appears that many non-nexus (and non-AOSP) devices are running code very dissimilar to AOSP in kitkat. I was actually surprised to see that the LG G2's bluetooth module was extremely similar to AOSP.
Take care
Gary
Click to expand...
Click to collapse
The reason I said it was Google that screwed it up is that there are a lot of people having the same problems that have a Nexus 4/5 and that runs pure Google android....
Regards,
Alan
SickPhone4X said:
Does this fix the problems with only AOSP, or will it work on stock rooted devices as well? I have a 2012 Dodge with the 430N RHB. I've had messaging problems and "phone call completed" error since the 4.4.2 update. I appreciate the code, and I'm sure many others will find this post helpful as well.
Click to expand...
Click to collapse
That's a trick question. This fixes one (and only one) very specific issue on any device that's using the same code as Google has published for AOSP kitkat 4.4.2.
I have no idea whatsoever if any given device's firmware is based on AOSP or based on some other bluetooth code. (I've only confirmed that the bug exists in AOSP and the LG G2 firmware... and you didn't even mention which device you have.)
For your Dodge radio, the "SMS" support in the radio might announce something like "New SMS message from XXXX" when you get a new SMS. If the SMS came from a person you have in your contact list, "XXXX" should be replaced by that contact's name. With the bug that this fixes, "XXXX" will always be replaced with something like "unknown number" (even if the message originated from someone in your contact list.)
IF you have that issue, you can try this module to see if it resolves the problem. If the problem goes away (and it announces the proper message originator), then this applies to your device. If, on the other hand, it doesn't fix the problem, then this fix won't help you. (In that case, you'll likely see one or more errors in the xposed log and you can uninstall the module. It won't HURT anything to try it.)
Note that this module has nothing to do with phone calls, phone books, etc. It's ONLY related to SMS sender info.
Take care
Gary
Tried this on my Galaxy S5 with my Jeep 430N. No go so far, still getting "no number available" for every person.
Sent from my SM-G900V using XDA Premium 4 mobile app
thuddome said:
Tried this on my Galaxy S5 with my Jeep 430N. No go so far, still getting "no number available" for every person.
Click to expand...
Click to collapse
Can you post/attach a copy of the xposed log when this module is active? That should let me know if the module was able to hook the methods it expected or not.
thanks
Gary
garyd9 said:
Can you post/attach a copy of the xposed log when this module is active? That should let me know if the module was able to hook the methods it expected or not.
thanks
Gary
Click to expand...
Click to collapse
-----------------
May 29, 2014 3:01:05 PM UTC
Loading Xposed v54 (for Zygote)...
Running ROM 'KOT49H.G900VOYU1ANCG' with fingerprint 'Verizon/kltevzw/kltevzw:4.4.2/KOT49H/G900VOYU1ANCG:user/release-keys'
Loading modules from /data/app/mobi.xperiacle.xposed.mod.xbatterythemer-1.apk
Loading class mobi.xperiacle.xposed.mod.xbatterythemer.XMod
Loading modules from /data/app/org.garyndenise.xposed.btsmsmapfix-1.apk
Loading class org.garyndenise.xposed.btsmsmapfix.BTSmsMapFix
Loading modules from /data/app/com.botsone.higoogle-1.apk
Loading class com.botsone.higoogle.HiGoogle
Loading modules from /data/app/pl.suzume.xposed.samsungaltsymbols-1.apk
Loading class pl.suzume.xposed.samsungaltsymbols.SamsungAltSymbols
Loading modules from /data/app/com.oasisfeng.greenify-2.apk
Loading class com.oasisfeng.greenify.pro.FrameworkPatch
Loading class com.oasisfeng.greenify.pro.SettingsPatch
Loading modules from /data/app/ccc71.at.free-4.apk
Loading class ccc71.at.xposed.at_xposed_enabled
Loading class ccc71.at.xposed.at_remove_battery_icon
Loading class ccc71.at.xposed.at_remove_low_battery_warning
Loading class ccc71.at.xposed.at_apps
Loading class ccc71.at.xposed.at_fix_mnt_asec
Loading modules from /data/app/ma.wanam.xposed-7.apk
Loading class ma.wanam.xposed.Xposed
Loading modules from /data/app/com.mohammadag.xposedledcontrol-1.apk
Loading class com.mohammadag.xposedledcontrol.LedControlMod
Loading modules from /data/app/com.gertlily.xposed.touchwiz-1.apk
Loading class com.gertlily.xposed.touchwiz.ActivitySQBar
Loading modules from /data/app/com.gsamlabs.xposed.mods.enablebatterystatspermission-1.apk
Loading class com.gsamlabs.xposed.mods.enablebatterystatspermission.HookGetStatisticsMethodCall
Loading modules from /data/app/net.thinkindifferent.dataconnectioniconfix-1.apk
Loading class net.thinkindifferent.dataconnectioniconfix.DataConnectionIconFix
Loading modules from /data/app/ma.wanam.youtubeadaway-2.apk
Loading class ma.wanam.youtubeadaway.Xposed
Loading modules from /data/app/com.hunterx.pandorapatcher-1.apk
Loading class com.hunterx.pandorapatcher.Patches
Loading modules from /data/app/uk.co.villainrom.pulser.allowlongsms-1.apk
Loading class uk.co.villainrom.pulser.allowlongsms.AllowLongSMS
Hooking: android from /data/data/ccc71.at.free/xposed/at_crystal_apps
Hooking: android from /data/data/ccc71.at.free/xposed/at_sd_apps
XBatteryThemer: xbatterytheme.kmokhtar79.darkblueglass
[SamsungAltSymbols] INFO: Initializing hooks...
[SamsungAltSymbols] ERROR: com.diotek.ime.implement.view.KeyboardView#setSecondarySymbolStatus(int)#exact
[SamsungAltSymbols] INFO: Hooked succesfully!
Loaded app: com.vlingo.midas
---------- Post added at 09:10 AM ---------- Previous post was at 09:07 AM ----------
garyd9 said:
Can you post/attach a copy of the xposed log when this module is active? That should let me know if the module was able to hook the methods it expected or not.
thanks
Gary
Click to expand...
Click to collapse
I have not deleted the pair and re paired the device. Do you think that's necessary? I will try just in case.
thuddome said:
I have not deleted the pair and re paired the device. Do you think that's necessary? I will try just in case.
Click to expand...
Click to collapse
That's not needed. I don't see any error from my module, which indicates that either the bluetooth package was renamed by samsung, or that something else entirely is going on. I'll try to remember to repackage a new version with excess logging for you tonight to help diagnose the issue.
(I should warn you, however, that I'm married with kids, etc - so I might not get a chance to do it until the weekend.)
Take care
Gary
garyd9 said:
That's not needed. I don't see any error from my module, which indicates that either the bluetooth package was renamed by samsung, or that something else entirely is going on. I'll try to remember to repackage a new version with excess logging for you tonight to help diagnose the issue.
(I should warn you, however, that I'm married with kids, etc - so I might not get a chance to do it until the weekend.)
Take care
Gary
Click to expand...
Click to collapse
Thank you my friend, I completely understand. This has been going on since my S3 phone, so what's another hour, week, month... hehe :highfive:
I tried some of the bluetooth apps on playstore with no success. This has been frustrating, the Jeep radio has contact pics, etc and none of it works. I can have it read texts and use the bluetooth phone of course but nothing with contacts works.
I'm a techy (infrastructure architect), let me know if you need anything from me. Maybe I should learn some of this stuff...
BTW, Galaxy S5 Dev Edition, rooted, stock 4.4.2 image - MyGig-430N-RHB-Firmware 50.xx.xx
thuddome said:
This has been going on since my S3 phone
...
... the Jeep radio has contact pics, etc and none of it works. I can have it read texts and use the bluetooth phone of course but nothing with contacts works.
Click to expand...
Click to collapse
S3? Galaxy S3? Which version of android? (My wife had a SGS3 running the original ICS firmware and it worked perfectly for her without any mods needed.)
Your Jeep's 430 has contact pics? Now I'm really confused... This is the uconnect 430 head unit, right? I wasn't aware of ANY on-screen contact pics or even on-screen phone book for this head unit. In fact, it's always annoyed me that my wife's head unit didn't DISPLAY the phonebook, but could only be interacted with verbally...
Also, assuming it's the same uconnect 430 that I'm thinking of, if the phonebook itself isn't downloading properly to the radio (as you seem to describe) then this SMS MAP module can't work.... Even if this module sends the proper originator phone number for an SMS message, if there isn't a matching phone book entry already in the radio, then it'll always announce an unknown sender.
So, I guess we should take a couple steps backwards and re-assess the problem. First, I need to know if your phone book is even properly downloading into the radio head unit. Without that, SMS messages will always be announced as unknown (and this xposed module can't fix that.)
garyd9 said:
S3? Galaxy S3? Which version of android? (My wife had a SGS3 running the original ICS firmware and it worked perfectly for her without any mods needed.)
Your Jeep's 430 has contact pics? Now I'm really confused... This is the uconnect 430 head unit, right? I wasn't aware of ANY on-screen contact pics or even on-screen phone book for this head unit. In fact, it's always annoyed me that my wife's head unit didn't DISPLAY the phonebook, but could only be interacted with verbally...
Also, assuming it's the same uconnect 430 that I'm thinking of, if the phonebook itself isn't downloading properly to the radio (as you seem to describe) then this SMS MAP module can't work.... Even if this module sends the proper originator phone number for an SMS message, if there isn't a matching phone book entry already in the radio, then it'll always announce an unknown sender.
So, I guess we should take a couple steps backwards and re-assess the problem. First, I need to know if your phone book is even properly downloading into the radio head unit. Without that, SMS messages will always be announced as unknown (and this xposed module can't fix that.)
Click to expand...
Click to collapse
I have a 2012 Rubicon, with the 430 and the "older" Uconnect, not the new one that connects to the internet through the phone. When I pair it, it says it's downloading the phone book. I can see this if I hit the phone button right after pairing. It will say "Downloading Phone book". If I go in and have it pull up the phone book it will read me the names.... I've also tried adding favorite contacts or whatever it calls them, where the 430 has you send it contacts via bluetooth and that didn't change anything either. When I get an incoming call and the little white square pops up it will show the person's name, not sure if that's call id or from the phonebook on the 430.
When an incoming call comes in it pops up the screen (when in the phone screen) and there's what I assume is a contact picture but it just has the Jeep logo.
Let me go re-pair and manually download the phonebook and see if that makes any difference. Kind of start over from scratch, you got me thinking... that's scary
thuddome said:
I have a 2012 Rubicon, with the 430 and the "older" Uconnect, not the new one that connects to the internet through the phone.
Click to expand...
Click to collapse
I didn't even know there was a newer or older one. My wife has a 2013 Chrysler MommyMobile (town and country) with the uconnect 430 (garmin nav.)
Just so I know that we're talking about the same thing... let me know if pairing the phone is similar to what I describe: There's ZERO visual interface to this procedure and it's all done via voice commands. Even the pairing PIN number must be said verbally. It identifies each of your phones with a voice tag (which is just a recording of you identifying the phone.) Does that sound right?
In fact, here's a webpage for the system my wife has: http://www.driveuconnect.com/system/2013/chrysler/town_country/touch430nrhb/
That page has a video on the 'phone' tab that shows the pairing stuff.
thuddome said:
When an incoming call comes in it pops up the screen (when in the phone screen) and there's what I assume is a contact picture but it just has the Jeep logo.
Click to expand...
Click to collapse
I don't think it's a contact photo, but always a jeep/dodge/chrysler logo.
garyd9 said:
I didn't even know there was a newer or older one. My wife has a 2013 Chrysler MommyMobile (town and country) with the uconnect 430 (garmin nav.)
Just so I know that we're talking about the same thing... let me know if pairing the phone is similar to what I describe: There's ZERO visual interface to this procedure and it's all done via voice commands. Even the pairing PIN number must be said verbally. It identifies each of your phones with a voice tag (which is just a recording of you identifying the phone.) Does that sound right?
In fact, here's a webpage for the system my wife has: http://www.driveuconnect.com/system/2013/chrysler/town_country/touch430nrhb/
That page has a video on the 'phone' tab that shows the pairing stuff.
I don't think it's a contact photo, but always a jeep/dodge/chrysler logo.
Click to expand...
Click to collapse
Yeah that's it, on my Jeep it's a module in the center of the dash clear at the bottom under the panel with the net on it. The reason I know there's a new one is because I logged into Jeep's website one day and it had this icon the said "disconnected" and it said learn how to become connected. That took me to a page that explained that my uconnect was not connected but if I got the new uconnect it would connect to the internet through my phone. I ended up calling uconnect and they said sorry, won't work with the 430N.
So interesting thing just happened, when I wiped the phone book, pairing, everything and then re-paired it beeped on my phone for access to the contacts and call log, then a minute later beeped again for access to sms. I tried sending a text to myself and let the 430 pop up and announce, again it says "no number available". so then I created a new entry on the 430 with voice commands for myself. and repeated test, still says "no number available" so that would tell me it's how the phone is sending the number for the SMS alert. With a phonebook entry created on the 430 itself the phonebook entry would have to be in the correct format. It does provide names for callers when they call me so this seems to only be when I receive sms. Did the same thing on Galaxy S4 and I don't think my S3 would do sms to my Jeep at all. Can't remember.
thuddome said:
...it beeped on my phone for access to the contacts and call log, then a minute later beeped again for access to sms.
Click to expand...
Click to collapse
Perfectly normal. On some phones, it might actually prompt 3 times: One for the phonebook, one for call history, and a third time for message access. (On the other hand, I've seen it only prompt once in some cases.) Typically, you'll check a box that says "don't ask again" (or "remember answer" or something like that) and then tap the button allowing access.
thuddome said:
... it says "no number available"....
Click to expand...
Click to collapse
Okay, when I get home tonight, I'll try to repackage with some debugging info. I'll spam the xposed log with positive indicators when the hook is installed, and with some debug info each time the hook is called. It won't SOLVE anything, but at least it will provide some hints as to what may (or may not) be going on.
Take care
Gary
@thuddome, I've uploaded a version 1.0.debug of the module to the xposed repo. It's flagged as "Experimental" (because it can spam the xposed log.) To get it, go into the xposed installer, tap on "download", find "BTSMSMapFix" and tap it...swipe from right to left a couple times until you see the "settings" page, and change that to "experimental".
You should then be able to download the updated 1.0.debug version. After ensuring that it's selected, reboot so it takes effect, and then try again with your head unit.
Here are some key things to look for in the xposed log:
BTSmsMapFix successfully hooked setVCardFromPhoneNumber -- this means that the hook took place. If you don't see this line, it means that Samsung renamed the package from the standard "com.android.bluetooth" (which wouldn't surprise me.)
BTSmsMapFix set originator phone number to XXXXX -- You should see this after getting an incoming SMS message while your phone is connected to your head unit. "XXXXX" should be replaced with a phone number that starts "+1" (Assuming your in the US), and then 10 more digits. (If you post your log, please leave the +1 in there, but remove the rest of the phone number.)
BTSmsMapFix reverting to original code with incoming set to (true|false) -- You might see these, but hopefully not when you get a new incoming SMS.
Take care
Gary

[MOD][Xposed][4.4] Graffiti Height Fix

Update (Feb. 2016): ACCESS CO. released an official update for the Graffiti Pro app (v1.0.3) that addresses the height issue. So this module is no longer needed.
The classic handwriting recognition software from Palm, known as Graffiti™, is still available as a text input method for Android on the Play Store. Sadly, the publisher, Access Co., LTD., seems to have abandoned development and hasn't released any updates since 2011.
As a result, on modern Android devices with high resolution screens, the input area was too small to be useful... until now.
Graffiti Height Fix is an Xposed Framework module that makes the Graffiti™ input area taller on high resolution screens.
REQUIREMENTS
Rooted Android device
Xposed Framework
Graffiti™ 2.0.6 or Graffiti™ Pro 1.0.2 by ACCESS CO., LTD.
I am not affiliated with nor sponsored by ACCESS CO., LTD., I'm just a long time user of Graffiti since the old Palm days, who still finds it doing a much better job than any other text input method for handheld devices.
Source code on GitHub.
Also available on the Google Play Store.
Edit: if your device is really big and you don't want the text input area to be so large, see post #10 for half-height and two-thirds-height versions.
non root solution?
I am a long time graffitti user and unhappy that it doesn't work well on my LG G3. I'm excited by this solution, but concerned about rooting my phone. Will it mess up my Verizon service any? Is there another solution that doesn't require rooting?
The only ways I can think of to fix Graffiti without the need to root, are:
1) Official app updates from Access Co. (sadly unlikely at this point).
2) Modifying the app directly (something the Graffiti EULA explicitly forbids).
Just rooting won't cause any trouble with service. However, it might void the warranty or insurance, and you probably won't be able to install official Android OS updates from LG or Verizon while the device is rooted.
graffiti window height please...
I use graffiti since apple newton! This is the only keyboard which allows to enter text without paying attention to the screen. One request - with the fix ON the text field i too high now - can you please make it selectable height or simply half and/or 2/3 of the full size- I have got used to the already narrow strip of standard graffiti used at full HD resolution
Thank You for the idea!
I am not advanced enough to do it myself unfortunately even if the sources are available..
lukasz said:
I use graffiti since apple newton! This is the only keyboard which allows to enter text without paying attention to the screen. One request - with the fix ON the text field i too high now - can you please make it selectable height or simply half and/or 2/3 of the full size- I have got used to the already narrow strip of standard graffiti used at full HD resolution
Thank You for the idea!
I am not advanced enough to do it myself unfortunately even if the sources are available..
Click to expand...
Click to collapse
I can't build the module right now, but it should be enough to edit https://github.com/Nephiel/android-...hiel/graffitiheightfix/GraffitiHeightFix.java and change the lines
Code:
/*
* Consider a 480x800 px screen where Graffiti area is 232 px high,
* use the same aspect ratio for other resolutions.
*/
private static final double ASPECT_RATIO_PORTRAIT = 3.448; // (800/232) (approx.)
private static final double ASPECT_RATIO_LANDSCAPE = 2.069; // (480/232) (approx.)
to this for half-height
Code:
/*
* Consider a 480x800 px screen with a Graffiti area 116 px high,
* use the same aspect ratio for other resolutions.
*/
private static final double ASPECT_RATIO_PORTRAIT = 6.896; // (800/116) (approx.)
private static final double ASPECT_RATIO_LANDSCAPE = 4.137; // (480/116) (approx.)
or this for 2/3
Code:
/*
* Consider a 480x800 px screen with a Graffiti area 116 px high,
* use the same aspect ratio for other resolutions.
*/
private static final double ASPECT_RATIO_PORTRAIT = 5.161; // (800/155) (approx.)
private static final double ASPECT_RATIO_LANDSCAPE = 3.096; // (480/155) (approx.)
and recompile.
Adding a user-selectable setting would be a good solution, but that means adding a preference screen to the module - I don't know how to do that yet.
Hello! Thank You for the quick answer!
I will try to replace the text in the file, the only thing left is that I need to google "how to recompile"
little progress...
Hello,
I have modified GraffitiHeightFix.java for "half size"
installed JDK,
added "path" variable,
attempted to compile,
and ended with 14 errors:
Katalog: C:\temp3\src\net\nephiel\graffitiheightfix
2015-08-17 02:16 <DIR> .
2015-08-17 02:16 <DIR> ..
2015-08-17 01:30 2*962 GraffitiHeightFix.java
1 plik(ów) 2*962 bajtów
2 katalog(ów) 79*646*793*728 bajtów wolnych
C:\temp3\src\net\nephiel\graffitiheightfix>javac GraffitiHeightFix.java
GraffitiHeightFix.java:3: error: package de.robv.android.xposed does not exist
import static de.robv.android.xposed.XposedHelpers.findAndHookMethod;
^
GraffitiHeightFix.java:3: error: static import only from classes and interfaces
import static de.robv.android.xposed.XposedHelpers.findAndHookMethod;
^
GraffitiHeightFix.java:4: error: package android.content does not exist
import android.content.Context;
^
GraffitiHeightFix.java:5: error: package android.graphics does not exist
import android.graphics.Point;
^
GraffitiHeightFix.java:6: error: package android.view does not exist
import android.view.Display;
^
GraffitiHeightFix.java:7: error: package android.view does not exist
import android.view.View;
^
GraffitiHeightFix.java:8: error: package android.view does not exist
import android.view.WindowManager;
^
GraffitiHeightFix.java:9: error: package de.robv.android.xposed does not exist
import de.robv.android.xposed.IXposedHookLoadPackage;
^
GraffitiHeightFix.java:10: error: package de.robv.android.xposed does not exist
import de.robv.android.xposed.XC_MethodHook;
^
GraffitiHeightFix.java:11: error: package de.robv.android.xposed.callbacks.XC_Lo
adPackage does not exist
import de.robv.android.xposed.callbacks.XC_LoadPackage.LoadPackageParam;
^
GraffitiHeightFix.java:13: error: cannot find symbol
public class GraffitiHeightFix implements IXposedHookLoadPackage {
^
symbol: class IXposedHookLoadPackage
GraffitiHeightFix.java:26: error: cannot find symbol
public void handleLoadPackage(LoadPackageParam lpparam) throws Throwable
{
^
symbol: class LoadPackageParam
location: class GraffitiHeightFix
GraffitiHeightFix.java:33: error: cannot find symbol
XC_MethodHook setMeasuredDimensionHook = new XC_MethodHook() {
^
symbol: class XC_MethodHook
location: class GraffitiHeightFix
GraffitiHeightFix.java:33: error: cannot find symbol
XC_MethodHook setMeasuredDimensionHook = new XC_MethodHook() {
^
symbol: class XC_MethodHook
location: class GraffitiHeightFix
14 errors
C:\temp3\src\net\nephiel\graffitiheightfix>
Sounds like you are missing the Android SDK and the XposedBridge API. You could start here https://developer.android.com/sdk/installing/index.html
A good tutorial for creating Xposed modules is here https://github.com/rovo89/XposedBridge/wiki/Development-tutorial
Nephiel said:
Sounds like you are missing the Android SDK and the XposedBridge API. You could start here https://developer.android.com/sdk/installing/index.html
A good tutorial for creating Xposed modules is here https://github.com/rovo89/XposedBridge/wiki/Development-tutorial
Click to expand...
Click to collapse
I have installed android studio.... and went as far as opening modified copy of Your c:\temp3\src\net\nephiel\graffitiheightfix\GraffitiHeightFix.java
I have no experience with programming nor with compilation... I will read but this seems to be slightly complex to get it right.
No chances that You may have the chance to compile ? just in case - my email is: [email protected]
I have built two alternate versions of the module - one with a half-height text input area, and one with a 2/3rds height.
You can find them here:
Half-height version
2/3rds height version
Nothing else has changed other than the height difference and using an updated version of the Android SDK to build.
Please test and let me know if it doesn't work.
Thank You, It Works!
Nephiel said:
I have built two alternate versions of the module - one with a half-height text input area, and one with a 2/3rds height.
You can find them here:
Half-height version
2/3rds height version
Nothing else has changed other than the height difference and using an updated version of the Android SDK to build.
Please test and let me know if it doesn't work.
Click to expand...
Click to collapse
Thank You a lot for Your work! Fix works really well, for me 1/2 height is just perfect - slightly higher than the already reduced height Grafitti window on the Note 3. XDA developers allow great worldwide cooperation! Thank You for the clever concept and fixing one of the first text entry solutions for mobile devices!
Just a heads up: ACCESS CO. recently released an official update for the Graffiti Pro app that addresses the height issue. So this module is no longer needed. :victory:
Apparently the ad-supported free version is gone and the Pro version is now available for free.
Since the Palm days, through my HTC Wallaby and on to my current Note GT-N7000, I was just fine with Graffiti, later Graffiti Pro.
For the last several years I have been aware that a new update of Graffiti Pro would saddle my poor Note with a HUGE (shouting capitals intended) Graffiti input screen blocking out nearly half of my Note's viewable area. Diligently I avoided updating, but now Google has suddenly forced an unwanted update on me, in spite of my having selected No Automatic Updates. And so I now have an unwanted HUGE (shouting capitals intended) Graffiti input area.
Can anyone help me with:
1) an .apk for the older Graffiti Pro version with normally sized input area;
2) a way of completely blocking unwanted app updates from Google?
Yes I hear all the approval of the new size from all the up-to-date owners of "huge" new 'phones - Note 9 and suchlike - but it is not fair to the likes of me who were just fine with their original Galaxy Notes, that we can't readjust our Graffiti back to what it was. Of course it (including Google forced update policy) is all intended to force us to buy ever bigger, faster and more expensive devices. I realise that.
And now that there is a wonderful new HUGE (shouting capitals intended) version from Access Co. on Google, your "Graffiti Height Fix" doesn't work any more.
Perhaps you could develop a fix for this?
Ironic footnote: one AdamOutler once flamed me in these very fora for advocating such a "large" phone as the GT-N7000! Wonder what he thinks of the Note 9!
Update: Praise be for Titanium Backup! I was able to restore my old version of Graffiti Pro from an earlier backup after deleting the unwanted update.
I also discovered that with a recent pretty turbulent and large (42 MB) update to Open Street Maps from Google Play, said software site had taken it upon itself to update all my settings to "Automatic Update". I have now switched off every option which includes the word "automatic", so we'll see how that goes.
I would still be interested to hear from any developer with ways to restrain Google's unbridled lust for making us automatically lay all we have bare to their thirst for control of and data from our systems, such as forced updates.
As for Graffiti Height Control, I would describe it as useless, and I defend that. I do not use the term in today's lazy postmillennial sense as a catch-all for "bad", but simply because GHC does not function in any way. After installation it does not show as an app. It offers no modification whatever to Graffiti Pro 1.0.5's settings, which are obsessed with all things Japanese but little else. I really don't need a Japanese dictionary; this is not a language I ever intend to use, certainly not with Graffiti.
"Graffiti Height Control" does nothing, it has no use, i.e. it is useless.
By way of historical info, back in the days of The O2 XDA (or HTC Wallaby), which is how this whole forum started, Graffiti was part of the accompanying Windows OS. In a comfortably proportionate size. The Wallaby included a pen built into the aerial.
syncopath said:
"Graffiti Height Control" does nothing, it has no use, i.e. it is useless.
Click to expand...
Click to collapse
Graffiti Height Fix is a Xposed module that required Xposed to function, as it was clearly stated in this thread, in the Play Store app description, and in Xposed Repository.
But that is moot, since Access Co. updated Graffiti to address the height issue long ago, rendering this module unnecessary.
syncopath said:
By way of historical info, back in the days of The O2 XDA (or HTC Wallaby), which is how this whole forum started, Graffiti was part of the accompanying Windows OS. In a comfortably proportionate size. The Wallaby included a pen built into the aerial.
Click to expand...
Click to collapse
Windows never had Graffiti. It may have had a similar input method, but not the same. Graffiti was Palm OS only, Xerox patent shenanigans ensued, and finally Access Co. ended up with the rights.
syncopath said:
Update: Praise be for Titanium Backup! I was able to restore my old version of Graffiti Pro from an earlier backup after deleting the unwanted update.
Click to expand...
Click to collapse
I'm glad you found a solution that worked for you. Titanium Backup is a really useful tool indeed.
1. I have Xposed (for XPrivacy) but was still unable to do anything in the awful new version of Graffiti Pro about the excessive height.
2. Oh yes it did! If I could get it to start, I could show you my XDA from O2, running Windows Mobile, using Graffiti!
3. Titanium Backup is useful, but I am still scared that somehow I will lose my precious older version of Graffiti, which looks just as it did on Windows Mobile in 2002.
---------- Post added at 03:52 PM ---------- Previous post was at 03:50 PM ----------
Re: Windows Mobile, when I get home in June 2019 I will try to reanimate my HTC Wallaby and send you a screenshot.
---------- Post added at 04:44 PM ---------- Previous post was at 03:52 PM ----------
You may care to peruse the Wikipedia entry for Graffiti at https://en.wikipedia.org/wiki/Graffiti_(Palm_OS), where you will find the link you need on the words "Windows Mobile".
In the end I reinstalled the previous version of Graffiti Pro from the .apk and then deleted Google and Google services from my device. This stopped automatic update of Graffiti to the unwanted new version, freed up a whole lot of space, but also sadly cut me off from ever acquiring any more software from Google Play or whatever it is called nowadays on that GT-N7000 device. So be it then.
My one GT-N7000 is now suffering from recharging socket problems and is almost 10 years old, at which point I have promised myself a new 'phone as 10 years is the lifetime I consider I have a right to expect from a device so expensive and complicated as these.
So now I have purchased a second-hand Note 8 and am interested to see what I can do with it to extend my XDA experience. I sincerely hope "Knox Bit" will not destroy everything. Root privileges are essential to 50% of my programmes (sorry "apps").
@Nephiel, did you ever find the Windows Mobile OS I referred you to? You will see that Graffiti is much older than you may have realised.
syncopath said:
did you ever find the Windows Mobile OS I referred you to? You will see that Graffiti is much older than you may have realised.
Click to expand...
Click to collapse
I did find it. It dates back to '94. Windows Mobile was called CE then. It may have had Block Recognizer, but not Graffiti, even if only in name.
Funny thing is, I got an iPaq Pocket PC myself (got it for free as a hand-me down) back then, and now that I think about it, it had a similar input method, but it wasn't enabled by default. I don't even remember actually using it.

CameraX and Camera2Config Extender, Camera2Interop... stuck there, help needed :)

Hi all,
I1m developing a camera-using application in Java, and stuck at a point where i need to control the camera settings. Any help will be appreciated...
The main problem is that i need to lock white balance (or turn it on a fix state, as daylight, etc.). I found that there are 2 methods : Camere2Config Extender and Camera2Interop. The app needs to display a preview, and do some image analysis, which is already working. The WB control is enough to apply to the analysis, but as i understand, if i apply to the preview/config the camera, it will also affect the analyzer, as it gets the same frames.
Camera2Interop seems to be easier, but i cannot import (in Android Studio). Simply does not understand the "interop" in
Code:
import androidx.camera.camera2.interop.Camera2Interop;
import androidx.camera.camera2.interop.ExperimentalCamera2Interop;
What can i do to let the Studio import these?
Second, i tried Camera2Config.Extender. But cannot figure out how to extend the configuration, and which? The preview config seems to be the good choice.
But when i try :
Code:
PreviewConfig pConfig = new PreviewConfig.Builder().setTargetAspectRatio(aspectRatio).setTargetRotation(0).build();
Camera2Config.Extender camera2Extender = new Camera2Config.Extender(pConfig);
Preview preview = new Preview(pConfig);
I get a "error: incompatible types: PreviewConfig cannot be converted to ExtendableBuilder Camera2Config.Extender camera2Extender = new Camera2Config.Extender(pConfig);" message. It builds when i remove the Extender.
If anybody knows how to get rid of these, i'll be thankful

Categories

Resources