Categories
Mastering Development

Android location service stop working when app destroyed or goes in background

Hello I am building a location based application and I have created a service which works in background when app goes in background or destroyed and in my service class if I play audio in loop it works perfectly audio is playing continue even I destroy app and for getting user location I am using […]

Categories
Development

Firebase database initialization does not work

I’m building a user registration activity. I wrote a function to create a user and save his/her information in the realtime Database of Firebase. I initialized the database yet when I click the button to save the user information, nothing happens. Here is the code: private var etfirstname: EditText? = null private var etlastname: EditText? […]

Categories
Development

Can’t Upload Images to Fire base

I am trying to allow new users to upload profile pictures but whenever I attempt to register, the app crashes. After debugging the app I found that it always occurs due to line 175 having an empty user ID. Line 175 is: DatabaseReference myRef = firebaseDatabase.getReference(firebaseAuth.getUid()); I have been following this YouTube tutorial ,https://www.youtube.com/watch?v=-v1O9rxienU, and […]

Categories
Development

How to create unique id when new user sign in

I want to create unique id every time new user sign in through google login in firebase database i have tried many ways but its not creating unique key private void firebaseAuthWithGoogle(GoogleSignInAccount acct) { Log.d(TAG, “firebaseAuthWithGoogle:” + acct.getId()); //getting the auth credential AuthCredential credential = GoogleAuthProvider.getCredential(acct.getIdToken(), null); //Now using firebase we are signing in the […]

Categories
Development

sms not send android – android studio app for sms message

Hi i’m make app for send sms. the application reports that the sms was sent but it never arrives I live in Brazil, even putting the area code is not sent or is sent and never arrives. does anyone know how to fix this problem? what am I doing wrong? any help is welcome. <uses-permission […]

Categories
Development

How can I check bluetooth connection state? (not paired state)

I want if device isn’t bluetooth connected(but device is paired) sends a massage. first I get the set of paired devices. And if the device name is ‘AAA’ or ‘AA.A’, connects the device. If device is connected, it has no problem. but if device isn’t connected. just attempts connecting and it’s over. How can I […]

Categories
Development

Use startActivityForResult from class to activity

Couldn’t find a good answer for this. I have a class(no opened from MainActivity. There I want to call startActivityForResult, to know when to do something on the UI. How do I do it correctly? I passed the activity and context to the class. On class: private void init(){ Intent TestIntent = new Intent(); mActivity.startActivityForResult(TestIntent,MainActivity.TEST); […]

Categories
Development

android studio java database login problem

I’m a beginner, and I want to ask about a problem I’ve got with my app. I try to log with the data I put into the database but it recognizes nothing. Here’s the code of the DatabaseHelper Java file. I think the problem is with my checkData_pseudo_pass function. Thanks in advance for the response! […]

Categories
Development

How to use Connectivity manager.NetworkCallback to get network type

In my project I want to show the type of connection that is used. For example when the user enables wifi and opens the app The toast with WiFi enabled is shown if used mobile data then another toast should be shown. I used the following code to show the type but I found that […]

Categories
Development

Error: MainActivity is not abstract and does not override abstract method onClick(View) in OnClickListener

I need help with a problem. It’s probably an easy one, but I don’t know what to do! My error: error: MainActivity is not abstract and does not override abstract method onClick(View) in OnClickListener public class MainActivity extends AppCompatActivity implements View.OnClickListener { Button btRegister; ImageView circle1; TextView tvLogin; Button login; EditText mEmail,mPassword; FirebaseAuth fAuth; @Override […]