• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Duplicate class com.google.android.gms.location.places.zza ERROR when building in android studio

Im pretty new to android studio development and I`m having trouble when building my apk, Im using google maps for location tracking and firebase with pubnub for notifications.

My problem came when I added firebase and started to add the dependencies, and when I tried to build I get this error: Duplicate class com.google.android.gms.location.places.zza found in modules jetified-play-services-places-9.6.1-runtime.jar (com.google.android.gms:play-services-places:9.6.1) and play-services-places-placereport-17.0.0-runtime.jar (com.google.android.gms:play-services-places-placereport:17.0.0)

App Gradle:

apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'

android {
compileSdkVersion 28
buildToolsVersion '29.0.2'

defaultConfig {
applicationId "com.parse.starter"
minSdkVersion 17
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
multiDexEnabled true
}
dexOptions {
javaMaxHeapSize "4g"
}
buildTypes {
release {
/*minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'*/
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}

dependencies {
implementation 'com.parse.bolts:bolts-tasks:1.3.0'
implementation 'com.parse:parse-android:1.13.0'
implementation 'com.android.support:multidex:1.0.0'
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.android.support:support-v4:28.0.0'
implementation 'com.android.support:design:28.0.0'
implementation 'androidx.navigation:navigation-fragment:2.0.0'
implementation 'androidx.navigation:navigation-ui:2.0.0'
implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
implementation 'com.google.android.gms:play-services-maps:17.0.0'
implementation 'com.google.android.gms:play-services-location:17.0.0'
implementation 'com.android.support:multidex:1.0.3'
implementation 'com.android.support:cardview-v7:28.1.1'
implementation 'com.github.ar-android:DrawRouteMaps:1.0.0'
implementation 'de.hdodenhof:circleimageview:2.2.0'
implementation 'com.android.support:recyclerview-v7:28.1.1'
implementation 'nl.psdcompany:duo-navigation-drawer:2.0.8'
implementation group: 'com.pubnub', name: 'pubnub-gson', version: '4.31.0'
implementation group: 'com.fasterxml.jackson.core', name: 'jackson-core', version: '2.9.2'
implementation group: 'com.fasterxml.jackson.core', name: 'jackson-annotations', version: '2.9.2'
implementation group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.9.2'
implementation 'com.github.jd-alexander:library:1.1.0'
implementation 'com.google.firebase:firebase-messaging:17.3.3'
Module Gradle:

// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.3'
classpath 'com.google.gms:google-services:4.2.0'
}
}

allprojects {
repositories {
jcenter()
google()
maven{url "https://jitpack.io"}
}
}

task clean(type: Delete) {
delete rootProject.buildDir
}


ext {
compileSdkVersion = 28
buildToolsVersion = "29.0.2"

minSdkVersion = 17
targetSdkVersion = 28
}

Video playback problem

Are you using the default video player app? Check in the app's settings menu to see if there are any options to change relative to screen orientation.
If not, you might want to install a third-party media player app instead. Just suggestions but I use MX Player Pro and VLC, both have options buried in their settings to change the default playback orientation (i.e. use the device's default, or always Landscape or Portrait); an added benefit being both also have more options to customize the user interface along with supporting a wider range of media file types than the default player.

Google assistant

I agree with you for the most part. I had a similar issue with a file manager. The newer version removed some functions that were free and charged to get them back. The only problem is eventually, most older versions become incompatible with newer Android versions and you have to update or find a new app. I finally dumped the app that I had been using for years and found a new app that works fine.

👌🏻👌🏻

Action buttons on Broadcast receiver

Is it posible to make an action button that will cause notification to reappear after one hour. Then I want to make another action button that will cancel notification and make it reappear the next day again. Any ideas for how can I do this? Here is the code -> Main Activity:

  1. EditText write;
  2. Button notification;

  3. @override
  4. protected void onCreate(Bundle savedInstanceState) {
  5. super.onCreate(savedInstanceState);
  6. setContentView(R.layout.activity_main);

  7. notification = findViewById(R.id.notification);
  8. write = findViewById(R.id.write);

  9. notification.setOnClickListener(new View.OnClickListener() {
  10. @override
  11. public void onClick(View v) {



  12. Calendar calendar = Calendar.getInstance();
  13. calendar.setTimeInMillis(System.currentTimeMillis());
  14. calendar.set(Calendar.HOUR_OF_DAY, 12);
  15. calendar.set(Calendar.MINUTE, 57);
  16. calendar.set(Calendar.SECOND, 0);
  17. Intent intent = new Intent(getApplicationContext(), Notification_receiver.class);
  18. intent.putExtra("TEXT", String.valueOf(write.getText()).trim());

  19. PendingIntent pendingIntent =PendingIntent.getBroadcast(getApplicationContext(), 100, intent, PendingIntent.FLAG_UPDATE_CURRENT);

  20. AlarmManager alarmManager = (AlarmManager)getSystemService(ALARM_SERVICE);
  21. alarmManager.setInexactRepeating(AlarmManager.RTC_WAKEUP, calendar.getTimeInMillis(), AlarmManager.INTERVAL_DAY, pendingIntent);


  22. }
  23. });



  24. }
And here the Broadcast Receiver:

  1. public class Notification_receiver extends BroadcastReceiver {
  2. @override
  3. public void onReceive(Context context, Intent intent) {

  4. String text = intent.getStringExtra("TEXT");

  5. NotificationManager notificationManager = (NotificationManager)context.getSystemService(context.NOTIFICATION_SERVICE);

  6. Intent repeating_intent = new Intent(context, MainActivity.class);
  7. repeating_intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
  8. repeating_intent.putExtra("action","snooze");
  9. repeating_intent.putExtra("action","cancel");
  10. PendingIntent pendingIntent =PendingIntent.getActivity(context, 100, repeating_intent, PendingIntent.FLAG_UPDATE_CURRENT);

  11. Intent snoozeintent = new Intent(context, ActionBtnReceiver.class);
  12. snoozeintent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
  13. snoozeintent.putExtra("action","snooze");
  14. PendingIntent snzpendingIntent = PendingIntent.getActivity(context, 100, snoozeintent, PendingIntent.FLAG_UPDATE_CURRENT);

  15. Intent cancelintent = new Intent(context, ActionCancelBtnReceiver.class);
  16. cancelintent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
  17. cancelintent.putExtra("action","cancel");
  18. PendingIntent cnlpendingIntent =PendingIntent.getActivity(context, 100, cancelintent, PendingIntent.FLAG_UPDATE_CURRENT);





  19. NotificationCompat.Builder builder = new NotificationCompat.Builder(context)
  20. .setContentIntent(pendingIntent)
  21. .setSmallIcon(R.drawable.ic_launcher_background)
  22. .setContentTitle("Notification")
  23. .setContentText(text)
  24. .setAutoCancel(true)
  25. .addAction(R.drawable.ic_snooze_black_24dp, "Snooze", snzpendingIntent)
  26. .addAction(R.drawable.ic_cancel_black_24dp, "Cancel", cnlpendingIntent);
  27. notificationManager.notify(100, builder.build());

  28. }
The ActionBtnReceiver and ActionCancelBtnReceiver are empty because I don't know how to do it. Can you please help me? java android broadcastreceiver. I asked again but nobody answered me. So please help me because I can'y find a suitable answer anywhere.

[APP] Battery 100% Ready

Battery 100% Ready
Start a custom animation and/or notification when your device is fully charged

Demo

Screenshot



Does your Android device not have the notification led (e.g. Samsung s10+, s10, s10e, ...)?
No problem, be notified when the battery is fully charged, to save and extend its health.

Does your Android device have the notification led?
If you want to start a custom animation when your device is fully charged, Battery 100% Ready is the app for you.

JUST A CLICK AWAY
Simply activate the monitor function, customize its behaviour and get what you need.
The app automatically will notify you every time the device is fully charged, avoiding to bother the user if a charged device is connected to a charger.

Unlike other apps, which must be activated by the user when the device is being charged, Battery 100% Ready, once set, will continue to function autonomously, even if you reboot your device, so you never have to care about it again.

CONSUMPTION
Battery 100% Ready has no impact on the consumption of the device's battery because it is developed according to the new Android battery saving guidelines.

FEATURES
• One click policy
• Smart charge notification
• Fully customizable:
• Enable or not notification
• Enable or not notification sound
• Enable or not animation
• Choose any video on your device or use the default one
• Enable or not animation looping
• Enable or not keep screen on during the animation

We live for feedbacks, let we know your opinion.

Attention! If you use only notification, probably you need a third-part application to use efficiently Battery 100% Ready.

Stay tuned for further developments


PvP Strategy Android Game

I am searching for a game I tried around 2018
The game's artstyle is simplistic, the characters are made with simple shapes, where there are races like human, icelings, rats, and others.
It was a strategy game, the playingfield is a checkerboard, with two castles on both ends (players)
You have a deck of cards to summon minions with it, they will go forward for each turn until they get in the opponent's castle and decrease the opponent's HP. I've searched my Google Play library and still no luck. I hope someone here has an idea of what I'm talking about.

Design Patterns

A lot of people who rushed into android world , Didn't take their time in Java , Actually i am one from these people , So, We didn't learn some important topics , One of them is design pattern.
I am reading a book of design patterns and i'll try to walk through it with you i'll just add the flavor of android , I hope i'll will
So let's start with Adapter pattern

What is Adapter Pattern?
It's like the name suggests , Converting one class to another one keeping only the name of its methods name but functionality of the other's.

Why would i need it?
Sometimes you use a class for a while,Then, You find out that you need to switch to another one ,But, It will take you much time and efforts to edit all the code.

How to implement it?
Create a new class "Adapter" which has the name of the class you want to switch to "By extending it" and has an object of type of the old class , Use the data you passed to the old class in the new class.

Example
I'll get enough to show the concept , And, i'll wait your opinion if you need a kind of real example.

We need ,For example, Switch
class A to class B
Java:
public class A {
    private String Name;
    private String ID;
    private int age;

    public String getName() {
        return Name;
    }

    public void setName(String name) {
        Name = name;
    }

    public String getID() {
        return ID;
    }

    public void setID(String ID) {
        this.ID = ID;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }
}

Java:
public class B {
    private String mail;
    private String nickname;
    private int yearOfBirth;

    public String getMail() {
        return mail;
    }

    public void setMail(String mail) {
        this.mail = mail;
    }

    public String getNickname() {
        return nickname;
    }

    public void setNickname(String nickname) {
        this.nickname = nickname;
    }

    public int getYearOfBirth() {
        return yearOfBirth;
    }

    public void setYearOfBirth(int yearOfBirth) {
        this.yearOfBirth = yearOfBirth;
    }
}
Java:
public class AtoBadapter extends B {
    private String mail;
    private String nickName;
    private int year;
    private A a;
    public AtoBadapter(A a){
        this.a = a;
        convert();
    }

    @Override
    public String getMail() {
        return mail;
    }

    @Override
    public void setMail(String mail) {
        this.mail = mail;
    }

    @Override
    public String getNickname() {
        return nickName;
    }

    @Override
    public void setNickname(String nickname) {
        this.nickName = nickname;
    }

    @Override
    public int getYearOfBirth() {
        return year;
    }

    @Override
    public void setYearOfBirth(int yearOfBirth) {
        this.year = yearOfBirth;
    }
    private void convert(){
        this.mail = a.getName().concat("@yahoo.com");
        this.year = 2020 - a.getAge();
        this.nickName = a.getID();
    }
}

Java:
public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        A a = new A();
        a.setAge(20);
        a.setID("z0-4");
        a.setName("A");
        B b = new AtoBadapter(a);
        analyze(b);
    }
    public void analyze(B b){
        //Do what you need with B class

    }

}


weird crash

If this 'crashing' issue is only happening to the Running Services option, I don't have a clue as to how to fix that. Developer Options isn't an app, its an integral part of the Android OS.
But if this is about your the Android operating system that's not stable anymore (it's not just Running Services but your phone itself), if you're still covered by a warranty it might be time to take your phone into to have it looked over. Or if you prefer, try flashing a stock Samsung ROM yourself. Your profile shows your carrier is AT&T, go here:
https://www.sammobile.com/samsung/galaxy-s10-plus/firmware/SM-G975U1/ATT/
If that's not your carrier any longer, go here:
https://www.sammobile.com/samsung/galaxy-s10-plus/firmware/
Be sure to select the ROM that's an exact match to your model. ROMs are not interchangeable so be sure to pick the one that matches your model, your country, and your carrier. The download page of the ROM you select has instructions on what steps to take to do the flashing process.

Anyone have a Hyundai Koral tablet?

...Another problem is that some reviewers expect cheap tablets to perform like expensive ones.
Read through the link I posted from Wirecutter. Even if you don't want to buy their recommendations, scroll down through the article as they also include a lot of details about what metrics they use to make their choices based on typical consumer scenarios. This gives you a better idea to make more informed choices on what to buy and what to avoid.

How to get files from a Samsung with broken and blackout screen

You are really unlucky that it's an S6. Older Samsungs supported video output via MHL, which would let you mirror to a screen. And I think the current ones support HDMI via USB. But as far as I can tell the S6 supports no wired video output (and mirroring via chromecast is useless here as you can't enable it without seeing what you are doing).

You might think "what good does mirroring do if the touch doesn't work?", but you can control a phone using USB OTG and a keyboard or mouse, and although it involves a lot of tedious trial and error you can do quite a lot by swapping between a display and an input device (with one socket you can't use both at once, unless you can pair it to a bluetooth input device). But this doesn't help you because I can't think of a way of mirroring the S6's display other than wirelessly, and I'm sure you need to have already set that up to have a chance of it working now.

J5 won't boot up with sim card in

Hi my galaxy s7 edge recently died so I decided to put the sim into my old J5. Without a sim card in the phone boots up fine and connects to wifi etc. However when I put the micro sim in with a sim card adapter the phone wont boot up, If I start charging the phone with the sim card in then I get a black screen with the phone charging icon flashing and a slight vibration like a notification vibration. Any ideas on a fix? tried different charges and cables but same issue, the phone battery is also about 80% charged.

Filter

Back
Top Bottom