This is a shortcut wrap for this Github project. The project is started as an external activity from B4A. You will have to play around with it to see what it does. I have not tested all the functionality of the project.
You need at least Android 4.4 to run this project.
Posting the following:
1. B4A library files.
2. Link to the other Jars that are required. Download them from HERE and then copy them to your additional library folder.
3. The Java code - change it to your liking
Sample code:
Take note of the following in the B4A project and set your path to whatever the path might be on your own computer:
Also take note of the B4A manifest in case you start a new project:
The B4A wrapper is very simple but it took me a while to get the rest of the library sorted out...Enjoy!
You need at least Android 4.4 to run this project.
Posting the following:
1. B4A library files.
2. Link to the other Jars that are required. Download them from HERE and then copy them to your additional library folder.
3. The Java code - change it to your liking
Sample code:
B4X:
#Region Project Attributes
#ApplicationLabel: PDFCreator
#VersionCode: 1
#VersionName:
'SupportedOrientations possible values: unspecified, landscape or portrait.
#SupportedOrientations: unspecified
#CanInstallToExternalStorage: False
#End Region
#AdditionalRes: ..\resource
#AdditionalRes: ..\PDFCreator_res
'IMPORTANT!!!! YOU NEED TO SET THE FOLLOWING PATHS CORRECTLY FOR YOUR OWN COMPUTER!!!!!!!!!!!!!!!!!!
'THE BELOW PATH IS THE PATH FOR MY COMPUTER
#AdditionalRes: C:\ANDRIOD_SDK_TOOLS\extras\android\support\v7\appcompat\res, android.support.v7.appcompat
#AdditionalRes: C:\ANDRIOD_SDK_TOOLS\extras\android\support\design\res, android.support.design
#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
Private Label1 As Label
Dim pdfcreator As PDFCreator
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")
pdfcreator.Initialize("pdfcreator")
Label1.Visible = True
Label1.Text = "Wrapped by Johan Schoeman"
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub Button1_Click
pdfcreator.StartPDFCreator
End Sub
Take note of the following in the B4A project and set your path to whatever the path might be on your own computer:
B4X:
#AdditionalRes: C:\ANDRIOD_SDK_TOOLS\extras\android\support\v7\appcompat\res, android.support.v7.appcompat
#AdditionalRes: C:\ANDRIOD_SDK_TOOLS\extras\android\support\design\res, android.support.design
Also take note of the B4A manifest in case you start a new project:
B4X:
AddManifestText(
<uses-sdk android:minSdkVersion="19" android:targetSdkVersion="22"/>
<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(<activity
android:name="de.baumann.pdfcreator.MainActivity"
android:label="@string/app_name"
android:theme="@style/AppTheme.NoActionBar">
<!-- <intent-filter> -->
<!-- <action android:name="android.intent.action.MAIN" /> -->
<!-- <category android:name="android.intent.category.LAUNCHER" /> -->
<!-- </intent-filter> -->
<intent-filter>
<action android:name="android.intent.action.SEND" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="image/*" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.SEND" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="text/plain" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.SEND" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="application/pdf" />
</intent-filter>
</activity>
<activity
android:name="de.baumann.pdfcreator.ActivityEditor"
android:theme="@style/AppTheme.NoActionBar">
</activity>
<activity
android:name="de.baumann.pdfcreator.UserSettingsActivity" />
<activity
android:name="com.theartofdev.edmodo.cropper.sample.MainActivity" />
<activity
android:name="com.theartofdev.edmodo.cropper.sample.CropResultActivity" />
<activity
android:name="com.theartofdev.edmodo.cropper.CropImageActivity" />)
SetActivityAttribute(Main, android:screenOrientation, "portrait")
The B4A wrapper is very simple but it took me a while to get the rest of the library sorted out...Enjoy!