B4A Library Phone library v1.80 - RingtoneManager

Status
Not open for further replies.
This update adds a new object: RingtoneManager.
This object allows you to access the ringtones (set the default ringtone, get the default ringtone and show a ringtone picker).

See the documentation: Basic4android - Phone

Installation instructions:
- Unzip the attached file.
- Copy both files to the internal libraries folder.
- Right click in the libraries tab and press Refresh.
 

Attachments

  • Phone.zip
    73.9 KB · Views: 1,513

barx

Well-Known Member
Licensed User
Longtime User
Nice...

Sent from my HTC Vision using Tapatalk
 

frapel

Active Member
Licensed User
Longtime User
Erel you're great !!! :sign0188:

I imagine you're very busy and you found the time to give us RingTone Manager... honestly I was approaching to create myself this library but your inclusion into the Phone lib is surely the best choice...

Thanx again
 

fanfalveto

Active Member
Licensed User
Longtime User
i try that
B4X:
u = rr.AddToMediaStore(File.DirRootExternal,"zz.mp3", "zz", False, False, True, False)
rr.SetDefault(rr.TYPE_RINGTONE, u)
and this is the error
B4X:
java.lang.NullPointerException
    at anywheresoftware.b4a.phone.RingtoneManagerWrapper.AddToMediaStore(RingtoneManagerWrapper.java:93)
    at alanhm.vngsoft.music.main._label2_click(main.java:1191)
    at java.lang.reflect.Method.invokeNative(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:515)
    at anywheresoftware.b4a.BA.raiseEvent2(BA.java:175)
    at anywheresoftware.b4a.BA.raiseEvent2(BA.java:163)
    at anywheresoftware.b4a.BA.raiseEvent(BA.java:159)
    at anywheresoftware.b4a.objects.ViewWrapper$1.onClick(ViewWrapper.java:66)
    at android.view.View.performClick(View.java:4633)
    at android.view.View$PerformClick.run(View.java:19330)
    at android.os.Handler.handleCallback(Handler.java:733)
    at android.os.Handler.dispatchMessage(Handler.java:95)
    at android.os.Looper.loop(Looper.java:157)
    at android.app.ActivityThread.main(ActivityThread.java:5356)
    at java.lang.reflect.Method.invokeNative(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:515)


    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1265)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1081)
    at de.robv.android.xposed.XposedBridge.main(XposedBridge.java:132)
    at dalvik.system.NativeStart.main(Native Method)
java.lang.NullPointerException
manifest:
B4X:
AddManifestText(
<uses-sdk android:minSdkVersion="4"/>
<supports-screens android:largeScreens="true"
    android:normalScreens="true"
    android:smallScreens="true"
    android:anyDensity="true"/>)
    AddPermission(android.permission.READ_EXTERNAL_STORAGE)
    AddPermission(android.permission.WRITE_SETTINGS)
SetApplicationAttribute(android:icon, "@drawable/icon")
SetApplicationAttribute(android:label, "$LABEL$")
any idea?
thanks
 

Douglas Farias

Expert
Licensed User
Longtime User

same problem here
the first time works fine, i m using a try catch for now
 
Last edited:

ibra939

Active Member
Licensed User
Longtime User

really Awesome Erel so thanks i get it very useful you are great .....
 

RUNO

Active Member
Licensed User
Longtime User
Hi Erel
I want to communication service company code as an example *102#, but does not send code # with it .
Can you help me ?
My code two ways same reult .
1)
Dim H As Intent
H.Initialize(H.ACTION_VIEW,"tel:*102#")
StartActivity(H)

2)
Dim PCs As PhoneCalls
StartActivity(PCs.Call("*102#"))
 

G-ShadoW

Active Member
Licensed User
Longtime User

B4X:
Sub Call(Command As String)
    Dim i As Intent
    i.Initialize(i.ACTION_CALL, "tel:" & Command.Replace("#", "%23"))
    StartActivity(i)
End Sub

'call it like this

Call("*102#")
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…