Well, I did the modifications to the Phone.jar file and removed the references to the RingManager class and two functions... but it is still doing the same thing.
The strange thing is... when I declare LIB_Phone as Phone and then do a LIB_Phone. so it shows me the listing of the available functions - it still lists GetRingTone and SetRingTone() functions.
I wonder if GetRingerMode and SetRingerMode are ones it doesn't like (probably not GetRingerMode).
Lets try getting rid of those and recompiling.
I verified that neither GetRingerMode nor SetRingerMode are in the XML file as a <method>
I unchecked Phone, shut down, started it up, checked Phone.
When type LIB_Phone, there they are still. There must be some declaration of them in one of the other classes, maybe?
How is it still that they're in the list? Isn't the list that is created when you type LIB_Phone with a period at the end of it built from the declarations in the jar's .xml file?
AHAH! I guess that the Phone library must now be integrated with B24? I had a Phone Library inside my external libraries folder and removed it. Then rebooted B24 and THERE WAS STILL A PHONE LIBRARY.
What?
Thus, I must be modifying the wrong phone library file. There must be some embedded-in-B4A Phone library file that I need to modify?
It can't possibly know there is a phone library if I have completely removed it from the external library area and rebooted B4A unless there is ANOTHER Phone library, version 2.25, somewhere else.
Yep. There it is.
C:\Program Files (x86)\Anywhere Software\Basic4android\Libraries
I'm starting again...
First I grab the phone.jar and phone.xml and put them in a safe place (Originals folder)
Next I unpack phone.jar to anywheresoftware folder which contains b4a folder which contains phone folder using 7z.
In the phone folder I delete RingtoneManagerWrapper$1.class and RingtoneManagerWrapper.class
I run 7-zip, create archive, on the anywheresoftware folder and choose Archive format zip
I rename anywheresoftware.zip as phone.jar and agree to the complaint.
I load Phone.xml into Wordpad.
I find <class> just before the declaration of
<name>anywheresoftware.b4a.phone.RingtoneManagerWrapper</name>
and I put three spaces there so I can find it again.
I search for </class>, that's the end of the declaration. I highlight from there up to the gap where <class> is and delete that class.
I delete until there is no gap between
</class>
<class>
Next, I find the two function <method> names...
I delete this code:
<method>
<name>GetRingerMode</name>
<comment>Returns the phone ringer mode.
Value will be one of the RINGER constants.</comment>
<returntype>int</returntype>
</method>
Leaving no gap between </method> and <method> (probably unnecessary)
I then search for <name>SetRinger and remove that <method>
<method>
<name>SetRingerMode</name>
<comment>Sets the phone ringer mode.
Mode - One of the RINGER constants.
Example:<code>
Dim p As Phone
p.SetRingerMode(p.RINGER_VIBRATE)</code></comment>
<returntype>void</returntype>
<parameter>
<name>Mode</name>
<type>int</type>
</parameter>
</method>
That should do it (let's see if it really does). I now replace the old phone.jar and phone.xml with the new ones in the Libraries folder at C:\Program Files (x86)\Anywhere Software\Basic4android\Libraries
I'll uncheck Phone in the Libs area, shut down B24, restart it... check phone, recompile, upload to Amazon and see.
---
Just checked and GetRingerMode and SetRingerMode are now GONE, as they should be, when I type LIB_Phone with a dot. Tah-dah. First step done. Bet Amazon will like it now.
I compile the App to the phone, go to the App's Object folder, open Amazon's webpage:
https://developer.amazon.com/public/solutions/devices/fire-tablets
... and drop the .apk file on their drag-and-drop window under Android-Based Development. Then wait...
What will be frustrating is, if I upload it and it still gives me the same error.
And it did...
Same problem. It, apparently, wasn't those two functions it was looking for... or I didn't extract every last trace of the RingtoneManager. Let me find the listing of what functions are included in the RingtoneManager and see what else might still need to be deleted. I would definitely say that it's some function in the RingtoneManager that is bugging Amazon. Wish they'd tell us which particular API Call that it objects to!
Well, nothing more in RingtoneManager... Lets check permissions.
This looks suspect. Lets try removing that.
It might be the .VIBRATE permission which is causing it.
<class>
<name>anywheresoftware.b4a.phone.Phone.PhoneVibrate</name>
<shortname>PhoneVibrate</shortname>
<owner>process</owner>
<permission>android.permission.VIBRATE</permission>
<method>
<name>Vibrate</name>
<comment>Vibrates the phone for the specified duration.</comment>
<returntype>void</returntype>
<parameter>
<name>ba</name>
<type>anywheresoftware.b4a.BA</type>
</parameter>
<parameter>
<name>TimeMs</name>
<type>long</type>
</parameter>
</method>
</class>
I delete it out of the xml, uncheck Phone. Save it, quit, copy the new xml over and replace the old, restart, check Phone again. Compile.
Unfortunately I was using PhoneVibrate, so I will lose that capability if that is what is causing it. It seems like it must be a permission setting, though, that it's objecting to.
---
That's not it either; still gives the same error. Good, I didn't want to lose the capability of using PhoneVibrate (and what does PhoneVibrate have to do with ringtones, anyways). Why is Amazon even worrying about whether one is making an App which is a ringtone?
So, what does that LEAVE? Not much.
I wonder if it even has anything to do with the phone library?
Lets try disabling everything that uses the phone library and submit it (don't you hate when things aren't easy?).
... So, I just removed all traces of the Phone library from the App and it worked.
"Compatibility test successfully completed. We did not find any of the common issues that can prevent an app from being published to the Amazon Appstore"
So, it still is something that I'm doing.
I am waking it up when it is in sleep mode. How can that be related to it thinking the App is a ringtone? Do ringtones wake up Apps?
I have verified, so far, that when you cut out of the xml file GetRingerMode, SetRingerMode, VibratePhone class, WakeLock class, and turn off all uses of the Phone, only keeping the Dim Phone as *** statement... it still says it is a ringtone.
However, if one completely unchecks Phone and comments-out the Dim statement. It works.
And... the final test of the day. I removed all the class files for all of those from the .jar file and recompressed it. Still same problem.
That means that the problem is Amazon seeing some part of the phone library that isn't even being used by me in the App and reacting as if I am using it. Tomorrow I will remove the class definitions one-by-one until the problem stops - that should show which one is doing it.
Very weird.