Android Question [SOLVED]Serial connection tablet & phone over tablet hot spot?

camolas

Member
Licensed User
Hi,

I want to send serial data from my phone to my tablet over my tablet hot spot , B4A wifi-direct only work for me over my router wifi not over tablet hot spot.
Can this be done?

Manny thanks
 

camolas

Member
Licensed User
Hi,

Cant find a server code that can work for me i used the EchoClient on tablet (hot-spot) and a lot off server codes on phone (non hot-spot side) with no sucess, please advise me in what server code i must use?

Thanks
 

camolas

Member
Licensed User
Hi,

One final question can i "force" de phone to connect to the Tablet wifi hot spot programmatically?
With AObject example i have to go to settings, network and select manually to enter.

Thanks

Paulo
 

camolas

Member
Licensed User
One more time many thanks @Erel

I used Wifi Connect lib

Very simple code:
B4X:
#Region  Project Attributes
    #ApplicationLabel: B4A Example
    #VersionCode: 1
    #VersionName:
    'SupportedOrientations possible values: unspecified, landscape or portrait.
    #SupportedOrientations: unspecified
    #CanInstallToExternalStorage: False
#End Region

#Region  Activity Attributes
    #FullScreen: False
    #IncludeTitle: True
#End Region

Sub Process_Globals
    'These global variables will be declared once when the application starts.
    'These variables can be accessed from all modules.
Dim Wifi1 As WiFiConnect
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 Button1 As Button
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
    Wifi1.connectToSSID(Wifi1.WIFI_WPA, "name", "pass")
End Sub
Manifest:
B4X:
'This code will be applied to the manifest file during compilation.
'You do not need to modify it in most cases.
'See this link for for more information: http://www.basic4ppc.com/forum/showthread.php?p=78136
AddManifestText(
<uses-sdk android:minSdkVersion="4" android:targetSdkVersion="14"/>
<supports-screens android:largeScreens="true"
    android:normalScreens="true"
    android:smallScreens="true"
    android:anyDensity="true"/>
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE"/>
    )
SetApplicationAttribute(android:icon, "@drawable/icon")
SetApplicationAttribute(android:label, "$LABEL$")
AddPermission(android.permission.CHANGE_WIFI_STATE)
'End of default text.
Its nice to learn :)
 
Top