Just for fun - a wrap for this Github project. See this project for the libraries that should be enabled in B4A:
https://www.b4x.com/android/forum/t...th-google-play-services-android-vision.70417/
The same libraries need to be enabled for this project except for AndroidVisionOCR. You now need to enable GooglyEyes (attached). Posting the following:
1. B4A library files
2. B4A sample project
3. resource.zip - extract it and copy the resource folder to be on the same folder level as that of the /Files and /Objects folders of the B4A project
4. GooglyEyesRes.zip - extract it and copy the GooglyEyesRes folder to be on the same folder level as that of the /Files and /Objects folders of the B4A project
You can flip between the front and back cameras.
See this project for the other jars that you need in your additional library folder as well as the Google Repository requirements. This will only work with B4A V6.00
https://www.b4x.com/android/forum/threads/optical-character-recognition-with-google-play-services-android-vision.70417/
Take note of the B4A manifest file:
Sample Code:
Library:
GooglyEyes
Author: Github: Paul McCartney, Wrapped by: Johan Schoeman
Version: 1
https://www.b4x.com/android/forum/t...th-google-play-services-android-vision.70417/
The same libraries need to be enabled for this project except for AndroidVisionOCR. You now need to enable GooglyEyes (attached). Posting the following:
1. B4A library files
2. B4A sample project
3. resource.zip - extract it and copy the resource folder to be on the same folder level as that of the /Files and /Objects folders of the B4A project
4. GooglyEyesRes.zip - extract it and copy the GooglyEyesRes folder to be on the same folder level as that of the /Files and /Objects folders of the B4A project
You can flip between the front and back cameras.
See this project for the other jars that you need in your additional library folder as well as the Google Repository requirements. This will only work with B4A V6.00
https://www.b4x.com/android/forum/threads/optical-character-recognition-with-google-play-services-android-vision.70417/
Take note of the B4A manifest file:
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: https://www.b4x.com/forum/showthread.php?p=78136
AddManifestText(
<uses-sdk android:minSdkVersion="19" android:targetSdkVersion="23"/>
<supports-screens android:largeScreens="true"
android:normalScreens="true"
android:smallScreens="true"
android:anyDensity="true"/>)
SetApplicationAttribute(android:icon, "@drawable/icon")
SetApplicationAttribute(android:label, "$LABEL$")
SetApplicationAttribute(android:theme, "@style/MyAppTheme")
AddApplicationText(<meta-data
android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version" />
<meta-data
android:name="com.google.android.gms.vision.DEPENDENCIES"
android:value="face" />
<activity
android:name="com.google.android.gms.samples.vision.face.googlyeyes.GooglyEyesActivity"
android:icon="@drawable/icon"
android:label="Googly Eyes"
android:theme="@style/Theme.AppCompat.NoActionBar"
android:screenOrientation="fullSensor">
</activity>)
AddPermission(android.permission.CAMERA) ' Required to be able to access the camera device.
AddPermission(android.permission.GET_TASKS)
AddPermission("android.hardware.camera")
AddPermission("android.permission.FLASHLIGHT")
Sample Code:
B4X:
#Region Project Attributes
#ApplicationLabel: b4aGooglyEyes
#VersionCode: 1
#VersionName:
'SupportedOrientations possible values: unspecified, landscape or portrait.
#SupportedOrientations: portrait
#CanInstallToExternalStorage: False
#End Region
#AdditionalRes: ..\resource
#AdditionalRes: ..\GooglyEyesRes
'#AdditionalRes: C:\Users\----------2\Documents\Basic 4 Android\JOHAN APPS\JHS LIBS\resource\b4a_appcompat, de.amberhome.objects.appcompat
'#AdditionalRes: C:\ANDRIOD_SDK_TOOLS\extras\android\support\v7\appcompat\res, android.support.v7.appcompat
'#AdditionalRes: C:\ANDRIOD_SDK_TOOLS\extras\google\google-play-services\libproject\google-play-services_lib\res, com.google.android.gms
'#AdditionalRes: C:\ANDRIOD_SDK_TOOLS\extras\android\support\design\res, android.support.design
'#ExcludeClasses: .games, .drive, .ads, .fitness, .wearable, .measurement, .cast, .auth, .nearby
'#ExcludeClasses: .tagmanager, .analytics, .wallet, .plus, .gcm, .maps, .panorama
'#Extends: android.support.v7.app.AppCompatActivity
#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.
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
Dim ge As GooglyEyes
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("main")
ge.Initialize("")
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub Button1_Click
ge.StartGooglyEyes
End Sub
Library:
GooglyEyes
Author: Github: Paul McCartney, Wrapped by: Johan Schoeman
Version: 1
- GooglyEyes
Methods:- Initialize (paramString As String)
- IsInitialized As Boolean
- StartGooglyEyes
- android.permission.CAMERA