• 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
}

Micro SD failure/lack of storage space

Each time I insert a TF card I find it works for a while and then all data is lost.
Recovery programs fail to retrieve any files or photo's as though they were never on the card.
My other problem is that I cannot download apps and am constantly asked to delete other essentials.
I'm currently trying to set up a Fitpro smart wristband to monitor heartbeat, blood pressure etc but cannot do this.
TF cards I've used have been generic and also San Disc.
Phone in use is Wieppo S5 bought on Amazon with Android 7 Nougat.

Video playback problem

Not sure if this was addressed or not but for some reason all of my videos only play back in portrait mode on my computer, even the ones I recorded in landscape. This seem to have started after an update but I'm not sure if that was just a coincidence or not. This wasn't a problem until recently for whatever reason. I have an S10. Even when I "rotate" the video in the media player, it still keeps the vertical borders as if it was a portrait video. This is extremely annoying.

Accessories MIUI backup tool for Android

I have backed up the content of my Xiaomi smartphone (system, apps) and saved it on my Desktop, using the built-in MIUI backup tool. Can this content be restored and used on another Android phones which don't use the MIUI of Xiaomi ?? In other words, does the format of the backup good for restoring onto any Android phone or only for the MIUI phones ??

Regards

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


Update impossible "variant system version"

Hello , first my phone work with : Android version : 6.0 / HTC Sense version : 7.0 /
software number : 3.35.617.12
SORRY FOR MY BAD ENGLISH ... IM FRENCH :)

I bought a second-hand HTC One M9 in france 1year ago. When I just come back to home , I wanted to check if software updates was OK but It wasnt ok. The phone suggest me to dowload the software update number : 3.35.617.16. So I did it but its impossible to install it , I cant see :

"Variant system version-
We have determined that your phone may be running a modified version of its system sofware. For your protection,we cannot update your phone. Please revert your phone to the official Htc system software to update your phone. If you didnt modify your system software or would like help reverting your system , please contact us via the support section at htc website".

I already try to talk to HTC support but they cant help me anymore.

CAN SOMEDY HELP ME PLEAAAASE :) ?

Thank you very much. :)

Informations about my phone from HTC support : So, this IMEI is related to an HTC One M9 manufactured to be used in USA with the carrier called T-Mobile. Its warranty expired on march 26th of 2016".

viewer.php

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.

What Happened to Android 3.0's Tablet Features?

So! I've been going back down memory lane for a bit- even if i didn't get into Android until, maybe... 5.0, 6.0 with the Galaxy S5?
I've always had an incredible fascination with old and deprecated Operating Systems- especially ones that aren't even iterated on anymore, such as old Workstation OSes for things like Silicon Graphics, old MacOSes, NeXT, and so on, so forth- but overall, i've had a huge fascination with them almost the whole time i've been into technology.
So i decided i'd take a look down the history of Android, see what i think or find out that i didn't know. And then, i hit Android 3.0! Not a single video did an overview on phones, but there was a very good reason for that- 3.0 was, as you all probably know, designed for tablet specifically.

The features were actually really cool for the time it was released. It was way ahead of its time, trying to make Tablet Android a more productive, fleshed out and desktop-like experience to suit the larger screens. And i'm here wondering- where the hell did it all go?! All Tablet android does now is shrink things to make sure they aren't oversized on a tablet.

3.0 was way ahead of its time, putting forth tablet Android as a more fleshed-out, unique experience, when it'd be almost 7 or 8 years before this would begin to happen again, and now that these features have been removed, iPadOS and the iPad Pro pretty much reign supreme in the tablet-as-a-work-device market, which stinks as, if Android had its old Tablet features, iPadOS would pale in comparison, even as well-optimised for Tablets as it is. The only way to find a similar experience is through Samsung DeX, and you even have to splurge an extra hundred bucks on the keyboard cover for that to work.

These features need to come back, in my opinion, especially if Google decides to make a move to release a Pixel-brand Tablet. Between the taskbar-like navigation bar, the action bar at the top of the screen, it would make it so much more easy to navigate Android on a Tablet, and allow it to be much easier to use as a desktop-like device, something tablets are becoming more and more suitable for as technology grows.

SIM card slot 1 losing signal

Hello, my smartphone is Xiaomi Redmi 4X and is a little over 2 years old. My SIM card slot 1 is losing signal completely and it then regains the signal. This happens very often, no matter which SIM card I insert. I even ordered a new SIM card with the same phone number, that didn't help. I cannot determine whether this is a hardware or a software problem, as the card regains the lost signal. I usually have to wait for a minute when this happens.

Another HELP, Emergency!!

Right off the bat this Wasn't my doing (for those who have helped me before). Cousin gave a semi friend my hotspot access and password. I've toggled it off, but what other safety steps should I do to make sure she'll can't access my phone (pictures, videos, browser, etc). I've been turning off phone when not in use and I'm missing business calls. Anyone, Anyone at all know anything????

Slideshow - free digital signage software for Android

Hi guys,

I am working on Digital Signage app for various Android boxes, sticks, but also usable on tablets and Android TV. It is targeted at SOHO/SMB.

Google Play store: https://play.google.com/store/apps/details?id=sk.mimac.slideshow
Webpage: https://slideshow.milanfabian.com/

Some highlights of the app:
  • Possibility to load files via USB flash drive / web browser / FTP / synchronize from Google Drive
  • Possibility to create various screen layouts, playlists for different parts of the day
  • Usable also as a fully offline app
  • Free for personal and commercial use (paid branding possible)
I appreciate any feedback or suggestions for improvements.

Milan

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

    }

}


pulling out stylus pulls up some program I don't want to use

I just got this Note 9. Previously, I had an iPhone 6 and before that a Note 4. So I'm just learning this thing. I've installed a chess app, and I wanted to play it with the stylus. So I turn on the chess app and then pull out the stylus, but it automatically pops up some program for the stylus. It has a bunch of choices like "smart select", "screen write", "penup", and others. I'm sure I'll learn what that stuff is at some point, but right now I just want to play the chess game with the stylus. I don't see any way to take this stylus program off the screen. Anyone know?

Filter

Back
Top Bottom