Android Question Creating witget

Status
Not open for further replies.

hookshy

Well-Known Member
Licensed User
Longtime User
I am trying to set up a simple widget and I got the following error ?
AndroidManifest.xml:40: error: Error parsing XML: not well-formed (invalid token)
 

hookshy

Well-Known Member
Licensed User
Longtime User
I have deleted the project and start all over again ..while testing ..I have message on desktop
Problem loading widget ..What happend and how user will restart widget
What do I write in program to detect such failure ?
 
Upvote 0

hookshy

Well-Known Member
Licensed User
Longtime User
I try to figure out.
B4X:
AddManifestText(
<uses-sdk android:minSdkVersion="4" android:targetSdkVersion="14"/>
<supports-screens android:largeScreens="true"
    android:normalScreens="true"
    android:smallScreens="true"
    android:anyDensity="true"/>)
SetApplicationAttribute(android:icon, "@drawable/icon")
SetApplicationAttribute(android:label, "$LABEL$")
 
Upvote 0

hookshy

Well-Known Member
Licensed User
Longtime User
B4X:
Sub Process_Globals
    'These global variables will be declared once when the application starts.
    'These variables can be accessed from all modules.
Dim rv As RemoteViews
 

    Dim vari As Int
 
End Sub
Sub Service_Create

rv = ConfigureHomeWidget("wid2", "rv", 0, "Widget Name")
End Sub

Sub Service_Start (StartingIntent As Intent)

If rv.HandleWidgetEvents(StartingIntent) Then Return
End Sub

Sub Service_Destroy

End Sub
Sub rv_RequestUpdate
    rv.UpdateWidget
End Sub

Sub rv_Disabled
    StopService("")
End Sub
Sub btn_tip_click
ToastMessageShow("test",True)

rv.UpdateWidget

End Sub
Sub btn_buc_click
vari=vari+10
rv.SetText("lbl_buc",vari)
rv.UpdateWidget

End Sub
 
Upvote 0

hookshy

Well-Known Member
Licensed User
Longtime User
the widgets works ... I will add some pictures to the button
I acctualiy will want to send some values to process I do not know how will be possible .
I want user to send his daily expense for example
 
Upvote 0

hookshy

Well-Known Member
Licensed User
Longtime User
B4X:
rv.SetImage("btn_tip",LoadBitmapSample(File.DirAssets,"100.png",90dip,50dip))
where do I put this statement in order to configure witget buttons?
 
Upvote 0

hookshy

Well-Known Member
Licensed User
Longtime User
rv = ConfigureHomeWidget("wid2", "rv", ?????, "Widget Name")
it is possible to have changed the update value marked with ????? , default value was 0
 
Upvote 0

hookshy

Well-Known Member
Licensed User
Longtime User
the below statement goes to error loading widgets
B4X:
Sub btn_tip_click
ToastMessageShow("test",True)
rv.SetImage("btn_tip",LoadBitmapSample(File.DirAssets,"100.png",90dip,50dip))
rv.UpdateWidget

End Sub
 
Upvote 0
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…