Android SDK
Logora can be integrated natively into your Android applications. Here is a guide to using our SDK. A test is available here : https://github.com/Logora/LogoraAndroidTestApp
Installation (Java)
The SDK can be downloaded from a maven repository on Github Packages. Add the repository and the dependency to the build.gradle file of your application, using the latest version number. Use Github credentials to authenticate (see here).
repositories {
maven {
url = uri("https://maven.pkg.github.com/Logora/LogoraAndroidSDK")
credentials {
username = "GITHUB_USERNAME"
password = "GITHUB_TOKEN"
}
}
}
dependencies {
implementation 'com.logora:logora_sdk:VERSION_NAME'
}
Add this code to the AndroidManifest.xml file.
<intent-filter>
<action android:name="android.intent.action.RUN" />
<category android:name="android.intent.category.DEFAULT"/>
</intent-filter>
Utilisation (Java)
The SDK provides a WidgetFragment
that contains the summary block in the footer of the article. Insert this fragment into your article page, and it contains links to the discussion area which will launch a new activity. So there is no need to insert the debate area, just the footer block.
Constructor :
public WidgetFragment(Context context, String pageUid, String applicationName)
Parameters :
Context context
: app contextString pageUid
: page unique identifier, needs to be the same as the web integration one.String applicationName
: app name available on your Logora administration panel.String assertion
: JWT (JSON Web Token) to authenticate user.
Integration example :
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
WidgetFragment widget = new WidgetFragment(this.getApplicationContext(), "my-article", "logora-demo", null);
getSupportFragmentManager().beginTransaction()
.add(R.id.logora_widget_container, widget)
.commit();
}