HttpURLConnection Post Android

I am trying to use the tutorial here with the data I learned here to perform a HTTPUrlConnection POST Request. Every time I run it, the response gives the error message: "You Must enter a user name!" and "You must enter a password." Co

Alert the text color of the dialog box using

I have just updated the libraries version in my app and now the text color of the AlertDialog buttons are white. Before that it was the colorAccent attribute that specify them if I remember correctly. I've tried many different attributes and none of

Android: keyboard entry in Unit Test

I want to implement user interaction in my Unit tests, i want user to input some info that i need in order to log him in the app, here's what i've written: @Before public void setup() { mActivity = Robolectric.buildActivity(MainActivity.class).create

Button at the bottom of the screen

I have a layout that looks like this, <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical&quo

Saving dates in the Firebase database

Sorting some data based on dates in my Android application. It is stored as follows: Map<Year, Map<Month, Map<Day, Stuff>>> Year, month and day are simply containing integers. This cannot be saved to Firebase database since it is a map t

Change Github account in Android Studio

I have used one Github account to push an android project to Github from Android Studio. Now I have created another account on Github and want to push my another android project to this new account. But I am not able to find any option to change the

Unable to get current location Google Map Android

I know this question is similar to other question but i am unable to understand the procedure of getting my location in google map. I have tried lots of tutorials but i think i am missing something. I am using the following code in my main class : Lo

Connect to Android with the PHP web service

I want to make login with JSON. This is my login web service and my login activity in android studio. When i attempt to login it always response 1. It means it always success. Although the username and password is wrong. Can you tell me why is this h

The navigation drawer is late when opening and closing Android

I am at trying to to get my navigation drawer to run smoothly as there is a stutter/delay in transition when opening and closing the drawer. I would like this to run perfectly. Any help? public class MainActivity extends AppCompatActivity implements

Volley in Android no longer works?

I am trying to write some android code a bit more clearly (avoiding in-class definitions) but I stumbled upon a problem with volley described e.g. here, which does not seem to work! First, here is my code piece: public class ServiceStock { public Con

View help text under EditText with the board

I am trying to make something on these lines: I am able to show the hint using android:hint="Email Address" but unable to show the helper text - This will be your email username <android.support.design.widget.TextInputLayout android:layout_wi

Should I import appcompact_v7 to android studio

I'm porting from eclipse to android studio, do I need to import appcompat_v7 from my existing eclipse project into android studio?As stated in Android's Support Library Overview, it is considered good practice to include the support library by defaul

Error adding apcompat-v7 api level 22

I'm trying to add appcompat-v7 to my projct, however when I run gradle sync throws the following error: /path/app/build/intermediates/exploded-aar/com.android.support/appcompat-v7/22.2.1/res/values/values.xml Error:(2) Attribute "layout" has alr

{Need help !!} Google maps in Viewpager Fragment

Ive been trying to implement Google maps into a viewpager fragment, Ive followed many different tutorials but have fail miserably every time. If anyone has any incite into how to get something like this working i would be really happy!! below is the

R can not be solved, everything tried

I have really tried everything imaginable! Okay, I know everyone says that they have "tried everything" and I know that there are a million and one "R cannot be resolved" questions and tutorials. However, I have done them all, literall

Spring Rest Template The Put method is null, why?

Im using Spring Rest Template for Android, and am going to use the PUT method to update an method. But surprisingly the PUT methods ofter doesnt support parsing the result object, they are just void, how come? My understanding of proper REST support

Move / drag / zoom an imageview in Android

I am developing an app which takes a picture from camera and then applies an imageview on top of it. Now, I need to move and resize (with pinch) the imageview above the captured picture. First I've implemented a simple drag behavior which worked well

Get the directory of the SD card in an Android device

Below is the code written for retrieving the sd card directory. I have been using execution of command and changed into reading the /proc/mounts. My Question is whether it is the right code ? Not an expert on Linux OS. Will the /proc/mounts path be s

Difference between SlidingPaneLayout and NavigationDrawer

I really don't know what is the difference between these two approaches of creating navigation menu. So I read that both can be used as a container for two fragments (main fragment, detail fragment). So can you help me to understand which approach is

Convert Uri to String and Thong to Uri

I'm developing some Application which allows select image from SD Card, save it into database and set this value for ImageView. I need to know way for converting uri to string and string to uri. Now I used getEncodedPath() method of Uri, but, for exa

Eclipse autobuilding evil Android project

My Eclipse seems to have corrupted itself/my project. I renamed the id's of some TextViews in the XML and it changed the id's of some other TextViews in other XML files, causing many null pointer exceptions. When I try to rename them, the change the

Difference between rotation methods?

My question is in about rotate methods in android.graphics.Camera.In Docs,I saw these comments: public void rotateX (float deg) Since: API Level 1 Applies a rotation transform around the X axis. public void rotate (float x, float y, float z) Since: A

BroadcastReceiver to unplug the headphones

Hi i am working on an application that generate an event when ever the headphone is removed from the mobile phone. I have created a broadcast receiver with receive method as public void onReceive(Context context, Intent intent) { // TODO Auto-generat

Track the Admob event in Google Analytics

Is it possible to track Admob event that the user clicked on the ads in the Google Analytics . I use AdMob for showing ads. I want to track every click on ads in Google Analytics. How can I set up Event?I found the solution. Implement the AdMob inter

Is the location provider really a battery drain?

I need to implement location-based service. I don't need fine location, so no GPS is needed. Easiest would be to start listening for locations updates at app start, and leave it ON: mLocationMgr.requestLocationUpdates(LocationManager.NETWORK_PROVIDER

Videos not displayed in GridView

After having solved every of my previous issues to get the code running for retrieving videos from the sdcard and displaying them in the GridView, I still cannot see the videos. I don't know what I have done wrong that they won't show and the array i