Java Question Library Question B4A (Services module)??

giga

Well-Known Member
Licensed User
Longtime User
I am working on a portscanner java library. The code works as a straight Applet JAR. It contains a MAIN.
Trying to convert it to a B4A library and I need to know how to make it Start. Should this be setup as Service module in order to Start? THANKS in advance.
 

giga

Well-Known Member
Licensed User
Longtime User
There is no Main method in Android apps. Are you sure that this library is compatible with Android?

Not Sure, Maybe I misunderstood this but I thought you could set the entry point to a Main with this in the android manifest:
B4X:
<activity android:name=".MainActivity" android:label="@string/app_name">
    <intent-filter>
        <action android:name="android.intent.action.MAIN" />
        <category android:name="android.intent.category.LAUNCHER" />
    </intent-filter>
</activity>
Is this correct? can this be done in eclipse manifest and shows in B4A?

Thanks for your reply as always.
 

giga

Well-Known Member
Licensed User
Longtime User
What is this Main? A method or an Activity?

I was confused with Main() method and Main activity.:sign0137: I need to invoke callback methods for this library and remove the Main() Method to something else like Start() or Destroy().

Hope that works.

Thanks, Erel. Do you have any other suggestions.
 

giga

Well-Known Member
Licensed User
Longtime User
Using onCreate instead of Main() method, I had to add the launcher to the manifest and now the app stops responding on starting

B4X:
'PortScanner
AddApplicationText(
<activity
        android:name="com.portscanner.StartActivity" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>)
   'End of PortScanner

Any help appreciated.
 
Top