Posts

Showing posts with the label android

returning subscriber in RxJava after storing data fetch from webservice

returning subscriber in RxJava after storing data fetch from webservice I am trying to call the web service to fetch the data and storing it into database using following code. I have created a separate class to perform following operation. Now , the issue is i want to notify my activity when i successfully fetch and store data in database. if some error occurs then i want to show that on UI itself. somehow i am able to write a code to fetch the data using pagination but not sure how would i notify UI where i can subscribe catch the update related to progress and error if any. public Flowable<Response> getFitnessData() { Request request = new Request(); request.setAccess_token("d80fa6bd6f78cc704104d61146c599bc94b82ca225349ee68762fc6c70d2dcf0"); Flowable<Response> fitnessFlowable = new WebRequest() .getRemoteClient() .create(FitnessApi.class) ...

does not have valid android:name [duplicate]

<activity> does not have valid android:name [duplicate] This question already has an answer here: I have trouble with the INSTALL_PARSE_FAILED_MANIFEST_MALFORMED error where I looked into logcat where the following was my error: W/PackageParser: /data/app/vmdl-1226238136.tmp (at Binary XML file line #27): does not have valid android:name I looked into my manifest code and after searching through a lot of forums (adding . before my activity name, adding big letters and etcetera) it does not work. What is wrong with my activity name? Down below is my manifest code; <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="R.ekryt"> <uses-feature android:name="android.hardware.bluetooth" /> <uses-permission android:name="android.permission.BLUETOOTH" /> <uses-permission android:name="android.permission.BLUETOOTH_ADMIN" /> ...

Firebase “User is missing a constructor with no arguments”

Firebase “User is missing a constructor with no arguments” I am trying to retrieve my user details from the /User/ tree i have in Firebase. I have the following User object : public class User { private String name; private String email; private FirebaseUser firebaseUser; private String lastOnline; private LatLng latLng; private ArrayList<SwapLocation> locations; public User(){ } public String getName(){ if(firebaseUser.getDisplayName() != null && !firebaseUser.getDisplayName().equals("")) return firebaseUser.getDisplayName(); if(name != null && !name.equals("")) return name; return ""; } public void setName(String name){ this.name = name; } public String getEmail(){ if(firebaseUser.getEmail() != null && firebaseUser.getEmail().equals("")) return firebaseUser.getEmail(); if(email != nul...

The activity is not responding

Image
The activity is not responding I have been working on developing an application which needed login and signup screen. My register activity is not working properly. The application is unable to take user from the start screen to the register activity, first the error arose of absence of intent filter then I included the intent filter in the manifest file but it seems like my app is ignoring the register activity. I am attaching both manifest file and the activity code please have a look. Don't use images to share code, use code snippet. – tahsinRupam Jul 2 at 10:39 2 Answers 2 As images are suggesting there are two LAUNCHER Activities in your AndroidMenifest.xml file, so you will have to make one of them as DEFAULT category . LAUNCHER AndroidMenife...

Find connected bluetooth device name using adb? [duplicate]

Find connected bluetooth device name using adb? [duplicate] This question already has an answer here: Is there any way to find the connected BT device name using adb shell? My phone is rooted and I'm building a tasker profile which flashes the BT device name when connected. This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question. 1 Answer 1 You want to know your Bluetooth profile name or connected/paired device bluetooth name? Both names you can get by below command: adb shell dumpsys bluetooth_manager The above command will give the output like this: Bluetooth Status enabled: true state: STATE_ON address: A4:70:D6:80:56:3E name: Moto G (4) (This is your device name) time since enabled: 00:03:29.979 Bonded devices: C0:EE:FB:DA:70:6E [BR/EDR] Oneplus3 (This is connected device name) ................

Zipalign - Command not found - MAC terminal

Zipalign - Command not found - MAC terminal When I try to run Zipalign on an apk I get the error "Command not found" "Command not found" I am not that familiar with using terminal commands on the MAC but I have navigated to the SDK/Tools folder and run the following command: zipalign -v 4 Project1.apk Project1-aligned.apk I get Command not found I have tried placing the apks in the Tools folder and same result. Can someone help me to understand where the apks should be located and where I should run zipalign from? Thanks, I am very frustrated about this as it seems so simple. 17 Answers 17 Perhaps the current directory is not in your path? Try adding "./" before your command so ./zipalign -v 4 Project1.apk Project1-aligned.apk I will try, thanks. I will also include the full path to the apk. – Bill Mar ...

Some sort of error

Image
Some sort of error Something is wrong with my java file, but I don't know what it is. Can someone please tell me. BTW, I'm new to this Thank You Screenshot Nevermind I got it – Omar Jul 2 at 10:29 Close the question then. – JacksOnF1re Jul 2 at 10:36 3 Answers 3 Closing braces are missing as far as i can see. you need to give 2 closing braces after super statement you are missing closing } braces. put the 2 closing } braces after your onCreate() callback . } onCreate() Example:- package com.example; import.. public class MainActivity extends AppCompatActivity { @Override protected void onCreat...

Can AudioTrack play MIDI files?

Can AudioTrack play MIDI files? I want to know can AudioTrack Android play MIDI file? If not, which library can. Because I want the Android library which can play and control tempo of MIDI file for my app. "can AudioTrack Android play MIDI file?" , No. It plays uncompressed PCM. – Michael Nov 21 '13 at 8:37 Please read the docs : developer.android.com/reference/android/media/AudioTrack.html – 2Dee Nov 21 '13 at 8:54 Thank you Michael and 2Dee for you're answer. – M2Midnight Nov 21 '13 at 14:34 ...

Hide an option in a spinner

Hide an option in a spinner So I'm creating currency converting app on android I have two spinners and I'm trying to hide option from the second spinner when that option is already selected by the first spinner, like if i choose to convert from USD the second spinner USD option should disappear but I just don't have any idea how to hide an option I searched on google most question asks about hiding the whole spinner not option package com.currencyconverter; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.view.View; import android.widget.AdapterView; import android.widget.ArrayAdapter; import android.widget.Button; import android.widget.EditText; import android.widget.Spinner; import android.widget.TextView; import com.google.firebase.database.DatabaseReference; import com.google.firebase.database.FirebaseDatabase; import static com.currencyconverter.globalData.amountToBeConvert; import static com.currencyconverter.globalData.cur...

Socket connection in background

Socket connection in background I need to make an application where, while the user is authorized, it keeps the socket connection until it is logged out. For this purpose, a foreground service is created, which starts after the authorization of the user, and stops when it is logged out. It implements connection and reconnection on the socket. All works well until you press the power button and turn off the charging. After this, the user stops receiving pongs from the server and the SocketTimeoutException is received on the OkHttp, and also stops receiving messages on the socket. On JavaWebsocket The connection was closed because the other endpoint did not respond with a pong in time. is received, after which you can successfully create a new socket connection, but it will repeat the same problem in the loop. In the settings, the optimization of the battery for this application was disabled. What can I do to make a stable connection socket work in the background? Implementation of acti...

Couchbase Lite alternative [closed]

Couchbase Lite alternative [closed] I have an Android project whose use CouchBase lite 1.4 with CouchDB .We want to use the last CouchBase lite version but I have been reading this in the documentation about CouchBase Lite 2.0 : Android CouchBase lite 1.4 CouchDB CouchBase lite CouchBase Lite 2.0 The new protocol is incompatible with CouchDB-based databases. And since Couchbase Lite 2 only supports the new protocol, you will need to run a version of Sync Gateway that supports it. So I guess I have to migrate to Sync Gateway ?¿ as I can read here: Couchbase Lite 2.0's enhanced replication protocol is not compatible with CouchDB. The Sync Gateway 2.0 however will supporting both Couchbase Lite 2.0 mobile clients with the new protocol and the CouchDB enabled replication protocol. My problem is that I have not clear what is Sync GatAway,becouse in some places you can read that works with CouchDB in other place I can read that does not work. This question appears to be of...