Android + AndroidAnnotations REST API - android

I am trying to create a simple learning project with AndroidAnnotations, which will work with REST calls. I have followed this tutorial
https://github.com/androidannotations/androidannotations/wiki/Rest-API#rest
but with no luck. Project builds successfully, but at runtime, my #RestService is always null and I cannot get it to work.
Here is how my structure looks like:
build.gradle
apply plugin: 'com.android.application'
def AAVersion = '4.3.0'
dependencies {
annotationProcessor "org.androidannotations:androidannotations:$AAVersion"
compile "org.androidannotations:androidannotations-api:$AAVersion"
compile "org.androidannotations:rest-spring-api:$AAVersion"
compile 'com.fasterxml.jackson.core:jackson-core:2.7.2'
compile 'org.springframework.android:spring-android-rest-template:2.0.0.M3'
}
Interface (separate file):
#Rest(rootUrl = "https://api.github.com", converters = {StringHttpMessageConverter.class})
public interface GithubClient {
#Get("/search/repositories?q={searchString}")
GitResult getResult(#Path String searchString);
}
MainActivity:
public class MainActivity extends AppCompatActivity {
#RestService
GithubClient restClient;
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
#Click(R.id.btn_Request)
void requestCall(){
searchAsync();
}
#Background
void searchAsync(){
try {
GitResult result = restClient.getResult("angular");
} catch (RestClientException e){
Log.e("Rest error",e.toString());
}
}
}
AndroidManifest.xml:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.com.githubbrowser">
<uses-permission android:name="android.permission.INTERNET" />
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:supportsRtl="true"
android:theme="#style/AppTheme">
<activity android:name=".MainActivity_">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
Am I missing any package, or what am I doing wrong here? Any help or recommendations would be highly appreciated.

So the problem was that I was missing the following dependencies under build.gradle:
compile "org.androidannotations:rest-spring:$AAVersion"
compile 'com.fasterxml.jackson.core:jackson-databind:2.3.2'

Just to update this thread, currently compile is obsolete therefore I use this
// android annotation
implementation "org.androidannotations:androidannotations-api:4.5.2"
annotationProcessor "org.androidannotations:androidannotations:4.5.2"
implementation "org.androidannotations:rest-spring-api:4.5.2"
annotationProcessor "org.androidannotations:rest-spring:4.5.2"
implementation "com.fasterxml.jackson.core:jackson-core:2.9.7"
implementation "org.springframework.android:spring-android-rest-template:2.0.0.M3"

Related

Debugger doesn't go into MainActivity

I got strange problem with white screen and debugger not going into MainActivity. It goes into App class, but doesn't fire the onCreate in MainActivity.
However, if I start my app without debug - just run the app, or build app - it goes into MainActivity fine. I can't find anything specific in my app or any info on what it might be
here's manifest :
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.something.something">
<application
android:name=".App"
android:allowBackup="true"
android:icon="#mipmap/ic_launcher_new"
android:label="#string/app_name"
android:largeHeap="true"
android:roundIcon="#drawable/ic_launcher"
android:theme="#style/AppTheme">
<activity
android:name=".MainActivity"
android:screenOrientation="portrait"
android:windowSoftInputMode="adjustPan"
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>
</activity>
</application>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="com.android.vending.BILLING" />
<uses-permission android:name="android.permission.CALL_PHONE" />
<uses-permission android:name="android.permission.INTERNET" />
</manifest>
here's App :
public class App extends MultiDexApplication {
private static Api api;
private static Retrofit retrofit;
#Override
public void onCreate() {
super.onCreate();
initRetrofit();
initGlobalVars();
}
private static void initRetrofit() {
if (retrofit == null) {
HttpLoggingInterceptor logging = new HttpLoggingInterceptor(new
HttpLoggingInterceptor.Logger() {
#Override public void log(String message) {
Log.d("MyLog", "message: " + message);
}
});
logging.setLevel(HttpLoggingInterceptor.Level.BODY);
final OkHttpClient okHttpClient = new OkHttpClient.Builder()
.connectTimeout(20, TimeUnit.SECONDS)
.writeTimeout(50, TimeUnit.SECONDS)
.readTimeout(50, TimeUnit.SECONDS)
.addInterceptor(logging)
.build();
retrofit = new Retrofit.Builder()
.baseUrl(Setup.URL)
.addConverterFactory(ScalarsConverterFactory.create())
.client(okHttpClient)
.build();
api = retrofit.create(Api.class);
}
}
private void initGlobalVars(){
GlobalVariableKeeper.INSTANCE.init(this);
}
public static Api getApi() {
return api;
}
public static Retrofit getRetrofit(){
return retrofit;
}
}
and gradle
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.something.something"
minSdkVersion 21
targetSdkVersion 28
versionCode 27
versionName "0.35"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.google.code.gson:gson:2.8.2'
implementation 'com.android.support.constraint:constraint-layout:1.1.2'
implementation 'com.android.support:design:27.1.1'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'de.hdodenhof:circleimageview:2.2.0'
implementation 'com.google.android.gms:play-services:12.0.1'
implementation 'com.android.support:multidex:1.0.3'
implementation 'com.android.billingclient:billing:1.0'
implementation 'com.squareup.retrofit2:retrofit:2.1.0'
implementation 'com.squareup.retrofit2:converter-gson:2.1.0'
implementation 'com.squareup.retrofit2:converter-scalars:2.1.0'
implementation 'com.squareup.okhttp3:logging-interceptor:3.6.0'
}
repositories {
mavenCentral()
}

I/CrashlyticsCore: Crashlytics report upload complete but not show in dashboard

I have problem with Fabric. its a test project for find problem and do everything step by step in fabric documents, but i don't know what is mistake. please help me.
My Gradle:
buildscript {
repositories {
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'io.fabric.tools:gradle:1.+'
}
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
repositories {
maven { url 'https://maven.fabric.io/public' }
}
android {
compileSdkVersion 27
defaultConfig {
applicationId "com.mycompany.testtt"
minSdkVersion 17
targetSdkVersion 27
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.2'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
compile('com.crashlytics.sdk.android:crashlytics:2.9.4#aar') {
transitive = true;
}
}
My Manifest:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.mycompany.testtt">
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:roundIcon="#mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="#style/AppTheme">
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<meta-data
android:name="io.fabric.ApiKey"
android:value="9fd0b323bad2f5dae063288c94fd3a2317faa104"
/>
</application>
<uses-permission android:name="android.permission.INTERNET" />
</manifest>
Main Activity:
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Fabric.with(this, new Crashlytics());
// TODO: Move this to where you establish a user session
logUser();
setContentView(R.layout.activity_main);
}
private void logUser() {
// TODO: Use the current user's information
// You can call any combination of these three methods
Crashlytics.setUserIdentifier("12345");
Crashlytics.setUserEmail("user#fabric.io");
Crashlytics.setUserName("Test User");
}
public void forceCrash(View view) {
throw new RuntimeException("This is a crash");
}
After all, and error and testing, but nothing is still displayed on the dashboard.
I do everything step by step from fabric documents.
I have this problem for a few days, and anyway I've tested it, but I still have not gotten a result and does not display anything in the fabric dashboard. ApiKey is correct and I'm sure of it.
(sorry for English)

SugarORM NullPointerException on save() method

I need a database in my app and I chose SugarORM. But I can't even run a simple example. I have NullPointerException when I use save() method.
build.gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
defaultConfig {
applicationId "com.aleksandr.birukov.myapplication"
minSdkVersion 19
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.2'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
compile 'com.android.support:support-annotations:27.1.1'
compile 'com.github.satyan:sugar:1.4'
}
manifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.aleksandr.birukov.myapplication">
<application
android:allowBackup="true"
android:name="com.orm.SugarApp"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:roundIcon="#mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="#style/AppTheme">
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<meta-data
android:name="DATABASE"
android:value="notes.db" />
<meta-data
android:name="VERSION"
android:value="1" />
<meta-data
android:name="QUERY_LOG"
android:value="true" />
<meta-data
android:name="DOMAIN_PACKAGE_NAME"
android:value="com.aleksandr.birukov.myapplication" />
</application>
</manifest>
Note.java
package com.aleksandr.birukov.myapplication;
import com.orm.SugarRecord;
public class Note extends SugarRecord {
String title, note;
long time;
public Note() {
}
public Note(String title, String note, long time) {
this.title = title;
this.note = note;
this.time = time;
}
}
MainActivity.java
package com.aleksandr.birukov.myapplication;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
public class MainActivity extends AppCompatActivity {
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Note note = new Note("title", "desc", 100);
note.save();
}
}
I don't understand what I did wrong?
Make your class extend SugarRecord< Note >

Mopub Banner ads is not appearing

I am kind of newbie in Android Programming, So I Just want to Display Mopub banner ad in my app. I created the Sample app, also created Ad unit id in Mopub.
I successfully integrated SDK and following their https://developers.mopub.com/docs/android/banner/ instructions on this page.
but I don't know why my app which is Live on G-play Only sending the request but no impression. I also checked on my Phone & its true. No ads are displaying. Here is My Code
Can anyone Help me Please?
mainactivity.java:-
import com.mopub.mobileads.MoPubErrorCode;
import com.mopub.mobileads.MoPubView;
import static com.mopub.mobileads.MoPubView.BannerAdListener;
public class MainActivity extends AppCompatActivity implements BannerAdListener {
private MoPubView mBanner;
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
mBanner = (MoPubView) findViewById(R.id.bannerview);
mBanner.setAdUnitId("XXXXXXXXXXXXXXXXXXXXXXXX"); // Enter your Ad Unit ID from www.mopub.com
mBanner.setBannerAdListener(this);
mBanner.loadAd();
}
#Override
protected void onDestroy() {
mBanner.destroy();
super.onDestroy();
}
#Override
public void onBannerLoaded(MoPubView banner) {
Log.d("MoPub Demo", "Banner loaded callback.");
}
#Override
public void onBannerFailed(MoPubView banner, MoPubErrorCode errorCode) {
Log.d("MoPub Demo", "Banner failed callback with: " + errorCode.toString());
}
#Override
public void onBannerClicked(MoPubView banner) {
Log.d("MoPub Demo", "Banner clicked callback.");
}
#Override
public void onBannerExpanded(MoPubView banner) {
Log.d("MoPub Demo", "Banner expanded callback.");
}
#Override
public void onBannerCollapsed(MoPubView banner) {
Log.d("MoPub Demo", "Banner collapsed callback.");
}
}
Activity_main.xml:-
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Hello World!"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<com.mopub.mobileads.MoPubView
android:id="#+id/bannerview"
android:layout_width="fill_parent"
android:layout_height="50dp"
android:layout_alignParentBottom="true"
/>
</RelativeLayout>
Build.gradle(module.app):-
repositories {
// ... other project repositories
jcenter() // includes the MoPub SDK and AVID library
maven { url "https://s3.amazonaws.com/moat-sdk-builds" }
}
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
defaultConfig {
applicationId "com.your.prject.appmopubtest"
minSdkVersion 16
targetSdkVersion 27
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'com.google.android.gms:play-services-ads:12.0.1'
implementation 'com.google.android.gms:play-services-auth:12.0.1'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
implementation('com.mopub:mopub-sdk:4.20.0#aar') {
transitive = true
}
}
Build.gradle(project.appmopubtest):-
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
jcenter()
maven { url "https://s3.amazonaws.com/moat-sdk-builds" }
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
androidmanifest.xml:-
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.your.prject.appmopubtest">
<!-- Required permissions -->
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<!-- Optional permissions. Will pass Lat/Lon values when available. Choose either Coarse or Fine -->
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:roundIcon="#mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="#style/AppTheme">
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<!-- All ad formats -->
<activity android:name="com.mopub.common.MoPubBrowser" android:configChanges="keyboardHidden|orientation|screenSize"/>
<!-- Interstitials -->
<activity android:name="com.mopub.mobileads.MoPubActivity" android:configChanges="keyboardHidden|orientation|screenSize"/>
<activity android:name="com.mopub.mobileads.MraidActivity" android:configChanges="keyboardHidden|orientation|screenSize"/>
<!-- Rewarded Video and Rewarded Playables -->
<activity android:name="com.mopub.mobileads.RewardedMraidActivity" android:configChanges="keyboardHidden|orientation|screenSize"/>
<activity android:name="com.mopub.mobileads.MraidVideoPlayerActivity" android:configChanges="keyboardHidden|orientation|screenSize"/>
</application>
</manifest>

Firebase android facebook,google,email login interface does not popup

I've watched a tutorial on YouTube about how to integrate Firebase to android applications. Registered Firebase, add my facebook and app info, and add the necessary changes to my app but somehow my main interface which should show login screens does not show up. There is no build errors.
Here are my codes;
My build.gradle inside my app:
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.3"
defaultConfig {
applicationId "com.bogroup.ucuncuprogram"
minSdkVersion 16
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:25.0.0'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.google.firebase:firebase-core:9.4.0'
compile 'com.google.firebase:firebase-auth:9.4.0'
compile 'com.google.firebase:firebase-database:9.4.0'
//compile 'com.google.firebase:firebase-storage:9.4.0'
compile 'com.firebaseui:firebase-ui:0.4.4'
compile 'com.google.android.gms:play-services-auth:9.4.0'
compile 'com.android.support:animated-vector-drawable:25.0.0'
compile 'com.android.support:design:25.0.0'
compile 'com.android.support:support-v4:25.0.0'
compile 'com.android.support:cardview-v7:25.0.0'
compile 'com.android.support:customtabs:25.0.0'
compile 'com.android.support:recyclerview-v7:25.0.0'
//compile 'com.android.support:customtabs:25.2.0'
testCompile 'junit:junit:4.12'
}
apply plugin: 'com.google.gms.google-services'
My main java code:
package com.bogroup.ucuncuprogram;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.EditText;
import com.firebase.ui.auth.AuthUI;
import com.google.firebase.auth.FirebaseAuth;
public class MainActivity extends AppCompatActivity {
private static final int RC_SIGN_IN = 0;
EditText et;
private FirebaseAuth auth;
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
auth = FirebaseAuth.getInstance();
if(auth.getCurrentUser() != null){
//USER ALREADY SIGNED IN
Log.d("AUTH", auth.getCurrentUser().getEmail());
}else{
startActivityForResult(AuthUI.getInstance()
.createSignInIntentBuilder()
.setProviders(AuthUI.FACEBOOK_PROVIDER,
AuthUI.EMAIL_PROVIDER,
AuthUI.GOOGLE_PROVIDER)
.build(),RC_SIGN_IN);
}
}
#Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if(requestCode==RC_SIGN_IN){
if(resultCode==RESULT_OK){
//user logged in
Log.d("AUTH", auth.getCurrentUser().getEmail());
}else{
// user not authenticated
Log.d("AUTH", "NOT AUTHENTİCATED");
}
}
}
public void tikla(View v){
if (v.getId()==R.id.button){
Intent intent = new Intent(getApplicationContext(),ikinciekren.class);
CharSequence charlarim = et.getText();
intent.putExtra("anahtar",charlarim);
startActivity(intent);
//
}
/*
else if (v.getId()==R.id.button){
//
}
*/
}
}
My main build.gradle file (not under app)
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.2'
classpath 'com.google.gms:google-services:3.1.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
My android.manifest.xml file:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.bogroup.ucuncuprogram">
<uses-permission android:name="android.permission.INTERNET"/>
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:roundIcon="#mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="#style/AppTheme">
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".ikinciekren">
<intent-filter>
<action android:name="android.intent.action.IKINCIEKREN" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
</application>
</manifest>
Also added google-services.json file under app and facebook id under in string.xml file
Any help is appreciated. Thanks in advance.
Try changing startActivityForResult() to:
startActivityForResult(
AuthUI.getInstance()
.createSignInIntentBuilder()
.setProviders(Arrays.asList(
new AuthUI.IdpConfig.Builder(AuthUI.FACEBOOK_PROVIDER).build(),
new AuthUI.IdpConfig.Builder(AuthUI.EMAIL_PROVIDER).build(),
new AuthUI.IdpConfig.Builder(AuthUI.GOOGLE_PROVIDER).build()
))
.build(),
RC_SIGN_IN);
To learn more about authentication on Firebase UI library look at:
https://github.com/firebase/FirebaseUI-Android/tree/master/auth

Categories

Resources