how would i make a homereplacement app

obperryo

New Member
Licensed User
Longtime User
i would like to make my app a home replacement app how would i go about doing this. :sign0104: :sign0085:
and i have a bug where i have the word visible used for the object and when i compile my project to test it errors and says unknown member: visible why is this the IDE said i can use it and I've used this command before with no error please help i need this fixed thanks. :sign0085: :sign0104:
this is my code
red = what it has errored on before
B4X:
'Activity module
Sub Process_Globals
   'These global variables will be declared once when the application starts.
   'These variables can be accessed from all modules.
   

End Sub

Sub Globals
   'These global variables will be redeclared each time the activity is created.
   'These variables can only be accessed from this module.

   Dim Button1 As Button
   Dim scrollview1 As ScrollView
   Dim panel1 As Panel
End Sub

Sub Activity_Create(FirstTime As Boolean)
   activity.AddMenuItem ("Settings","Settings")
   activity.AddMenuItem ("Metro UI Settings","Metro UI Settings")
   activity.LoadLayout ("windowphone7")
End Sub

Sub Activity_Resume

End Sub

Sub Activity_Pause (UserClosed As Boolean)

End Sub

Sub Activity_KeyPress (KeyCode As Int) As Boolean 'return true if you want to consume the event
   If keycode = KeyCodes.KEYCODE_BACK Then
   Return True
   Else
   Return False
   End If
End Sub
Sub Settings_click
Dim intent1 As Intent
intent1.Initialize(intent1.ACTION_MAIN,"")
intent1.SetComponent("com.android.settings/.framework.activity.HtcSettings")
StartActivity(intent1)
End Sub
Sub Metro_UI_Settings_click
panel1.[COLOR="Red"]Visible[/COLOR] = True
End Sub
Sub panel1
panel1.[COLOR="Red"]LoadLayout[/COLOR]("Metro_UI_Settings")
End Sub
Sub Button1_Click
button1.BringToFront
scrollview1.[COLOR="Red"]Visible[/COLOR] = True
If scrollview1.Visible = True Then
Return scrollview1.Visible = False
End If
End Sub
Sub scrollview1

End Sub
when i compile my project it give this error
B4X:
Compiling code.                         Error
Error compiling program.
Error description: Unknown member: visible
Occurred on line: 53
scrollview1.Visible = True
Word: visible
and do you think you could possibly add in the feature for home replacement app in the next version of basic4android please and thank you
 
Last edited:

alexb

Member
Licensed User
Longtime User
how would i make a homereplacement app: NEED IT TOO!!!

Erel, I would need the home replacement feature too. I have tried to modify exisiting code from the Android sample apps ("Home") with Eclipse but failed to succeed. Any tip how a B4A app can be turned to a home screen app, maybe by modifying directly some java files or the Android manifest file or... ???

THANK YOU!:sign0085:
 
Upvote 0

alexb

Member
Licensed User
Longtime User
Maybe the solution...

Not knowing yet whether this is really a solution or just luck I have been successful to make a small dummy program acting as home screen by changing the following lines in the AndroidManifest file ("Objects" folder):

From:
<category android:name="android.intent.category.LAUNCHER" />

To:
<category android:name="android.intent.category.HOME"/>
<category android:name="android.intent.category.DEFAULT"/>

I have then set the 'read-only' attribut to the modified file to avoid overwriting by the B4A compiler engine, recompiled the app and voila...
=> at least in the emulator the dummy app is now presented as a 2nd option to select when pressing the 'Home' button.

If anybody wants to try this as well I would be happy tp reveive some feedback on your results, problems encountered later with your real apps on real devices.

If Erel finds some time after this fantastic new 1.5 release maybe he can comment on this 'solution' as well.:)
 
Upvote 0
Top