B4X:
			
		
		
		#Region  Project Attributes 
    #ApplicationLabel: Free Wifi
    #VersionCode: 1
    #VersionName: 
    'SupportedOrientations possible values: unspecified, landscape or portrait.
    #SupportedOrientations: unspecified
    #CanInstallToExternalStorage: False
#End Region
#Region  Activity Attributes 
    #FullScreen: False
    #IncludeTitle: False
#End Region
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.
    Private Button2 As Button
    Private Button1 As Button
    Dim a As Hotspotlib
    Private Button3 As Button
    Private CheckBox1 As CheckBox
    Private txtmatkhau As EditText
    Private txtten As EditText
    Private RadioButton2 As RadioButton
    Private RadioButton1 As RadioButton
End Sub
Sub Activity_Create(FirstTime As Boolean)
    'Do not forget to load the layout file created with the visual designer. For example:
    Activity.LoadLayout("1")
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub Button1_Click
        a.tat
    ToastMessageShow("Starting turn off wifi hotspot and exit, please wait.......",True)
    Activity.Finish
End Sub
Sub Button2_Click
    a.tat
If RadioButton2.Checked=True Then
    a.batdau(txtten.text,True,txtmatkhau.Text)
    ToastMessageShow("Starting turn on wifi hotspot " & txtten.Text & " with password " & txtmatkhau.Text & ", please wait.......",True)
    Else
    ToastMessageShow("Starting turn on wifi hotspot " & txtten.Text & " without password, please wait.......",True)
    a.batdau(txtten.text,False,"")
    End If
End Sub
Sub Button3_Click
    a.tat
    ToastMessageShow("Starting turn off wifi hotspot, please wait.......",True)
   
End Sub
Sub CheckBox1_CheckedChange(Checked As Boolean)
    If CheckBox1.Checked=True Then
    txtmatkhau.PasswordMode=False
    Else
    txtmatkhau.PasswordMode=True
    End If
End Sub
	With full project and library
source : http://basic4ppc.com/android/forum/threads/hotspot-in-b4a-is-it-impossible.41704/
and http://www.b4x.com/android/forum/threads/wifi-tetherinf.27048/#post-156666