Beagle v1.6 is no longer actively maintained. The documented version you are viewing may contain deprecated functionality. For up-to-date documentation, see the latest version .
Before you start to configure Beagle for your Android system, it’s important to check out if you have installed all the current versions of the following programs:
This tutorial will configure Beagle from the Start.
Add mavenCentral()
into the All projects
block on your Project Gradle file(build.gradle)allprojects {
repositories {
google()
jcenter()
mavenCentral()
}
}
Add the packagingOptions code block to the build.gradle file, as in the example below.
The version numbers listed below may have been updated. Please check the actual versions on the tags above:
plugins {
id 'com.android.application'
id 'kotlin-android'
id 'kotlin-android-extensions'
id 'kotlin-kapt'
}
android {
kotlinOptions {
jvmTarget = JavaVersion.VERSION_1_8
}
packagingOptions {
pickFirst 'META-INF/LICENSE.md'
pickFirst 'META-INF/LICENSE-notice.md'
}
}
dependencies {
implementation "br.com.zup.beagle:android:1.5.1"
kapt "br.com.zup.beagle:android-processor:1.5.1"
implementation "br.com.zup.beagle:beagle-scaffold:1.0.0"
}
@BeagleComponent
class AppBeagleConfig: BeagleConfigScaffold()
When building this application the config above will setup Beagle in your project.
class AppApplication : Application() {
override fun onCreate() {
super.onCreate()
BeagleScaffold(BeagleSetup()).init(this)
}
}
In this last step you will add two configurations to the android manifest: The internet permission and your application's name
<uses-permission android: name = "android.permission.INTERNET" />
<application
android: name = ". AppApplication"
...
<? xml version = "1.0" encoding = "utf-8"?>
<manifest xmlns: android = "http://schemas.android.com/apk/res/android"
package = "com.example.beagleexamples">
<uses-permission android: name = "android.permission.INTERNET" />
<application
android: name = ". AppApplication"
...
To test it you just need to call a screen from our BFF sample.
To do that you need to start an activity using the BeagleIntent
from the Beagle-Scaffold lib exactly as shown below:
class MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
//Server-driven Screen
startActivity(BeagleIntent(this).toSample())
}
}
A sample screen with all Beagle components will show on your emulator screen
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.