Questions tagged [android]

Android is Google's mobile operating system, used for programming or developing digital devices (Smartphones, Tablets, Automobiles, TVs, Wear, Glass, IoT). For topics related to Android, use Android-specific tags such as android-intent, android-activity, android-adapter, etc. For questions other than development or programming but related to the Android framework, use this link: https://android.stackexchange.com.

android
Filter by
Sorted by
Tagged with
0 votes
1 answer
61 views

how can make this code in to a callable method class

I have these 2 lines of code that get called over and over. At the moment every time I want to use it I type it in. Was wondering how to put it into a callable method/class that I could instead ...
Mark Harrop's user avatar
0 votes
1 answer
109 views

How do i remove this small gap on the edges of my layout in Android? [duplicate]

Here's a screen shot of my activity: I want to remove the gaps on the left and on the top Here's my activity's xml: <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" ...
Veneet Reddy's user avatar
  • 2,767
2 votes
1 answer
1k views

How to create a custom step slider/range group?

I know how to set a background for a radio group and custom image for radio button. My question is, how would I create a range slider like this one used in the Uber app that changes the image of the ...
Steve C.'s user avatar
  • 1,343
0 votes
0 answers
218 views

Android: Out of memory on a 150994960-byte allocation

If I use a genymotion emulator it works well, but if i'm testing it on my phone it won't respond. I realy don't know why, but if I do set ContentView. I get the following error: 03-18 12:09:39.291 ...
user3432681's user avatar
0 votes
2 answers
461 views

Tapping in the centre of screen for Camera App Android

I got one scenario where I need to tap on the screen to take a photo in Samsung Note device. Can someone provide me an idea like how can I perform single tap in the centre of the screen.
Vignesh's user avatar
  • 165
2 votes
0 answers
3k views

Send and Receive USSD commands and responses via PHP

I have an idea and I would like to be able to send USSD commands and receive USSD responses using a GSM SIM card via PHP. Such as Example Command *555* Example Response from GSM provider 1. ...
Naveen Gamage's user avatar
-3 votes
1 answer
4k views

How to Decode MD5 String in Android? [closed]

I am using this code for encoding MD5. Please tell me how to decode this. public static final String md5(final String toEncrypt) { try { final MessageDigest digest = MessageDigest....
Pankaj Singh's user avatar
0 votes
1 answer
62 views

How to show images in gallery when you have added image in internal memory

I have added image in internal memory using code Bitmap bitmap = BitmapFactory.decodeResource(getResources(),R.drawable.blue_500); FileOutputStream fileOutputStream = openFileOutput("file....
Sunil Patel's user avatar
6 votes
2 answers
4k views

Android: after installing an APK, the open button is disabled

I read in so many places that the problem is related to the manifest and the definition of the first activity. It seems that I'm doing fine but still the open button, after installing the APK, is ...
Amos's user avatar
  • 1,331
0 votes
1 answer
96 views

AspectJ pointcut for AsyncTask in android app

I am trying to have details of Http calls made in android app. I have my SDK embedded in app. The app makes use of AsyncTask and HttpURLConnection to make http calls. Hence I am thinking it will be ...
teksan's user avatar
  • 152
1 vote
1 answer
607 views

I need to return result with volley library [duplicate]

> public void makeJsonObjectRequest(Long s,Double lat, Double lon, int > timezone) { > String urlJsonObj = "http://projet.dev.e-njaz.com/api/example/getPrayerTimes/" + s + "/" + >...
El Mehdi El Ghali's user avatar
11 votes
2 answers
6k views

Custom view of Limit Line in MPAndroidChart

Is it possible to replace LimitLine with custom layout? So it looks something like this: I see few solutions for that: Perhaps there're methods inside library for customizations like this, are ...
AnZ's user avatar
  • 1,050
6 votes
5 answers
4k views

android - Implement UP button action with Navigation Drawer

Question I am using Navigation Drawer from Android Studio Template. I want to use UP button (arrow) in some of my fragments instend "Hamburger" button. I use AppCompatActivity. I use this code to ...
Alexey Markov's user avatar
6 votes
4 answers
3k views

How to disable floating while showing error in TextInputLayout

<android.support.design.widget.TextInputLayout android:id="@+id/productLayout" android:layout_width="match_parent" android:layout_height="wrap_content" app:...
Vaisakh N's user avatar
  • 780
1 vote
1 answer
1k views

Opening links from Cordova app in external app - facebook, twitter or browser - both for iOS and Android

Recently we upgraded our app to Cordova 6.0.0 and updated our iOS and Android platforms (to versions 4.1.0 and 5.1.1 respectively). Following this upgrade, old code we had to handle links stopped ...
SBStack's user avatar
  • 146
2 votes
2 answers
3k views

Change theme for button programmatically

I can able to set theme to button using android:theme attribute in xml. Is there any equivalent programmatical code? <Button android:id="@+id/btnPayment" android:layout_height="...
KDeogharkar's user avatar
0 votes
2 answers
91 views

How to launch our application when user click on a weblink in system application like hangouts?

I want to launch my application if user click on a web link in another application and if user wants to open that link with my application.I used following intent filter <intent-filter> ...
Nagaraju V's user avatar
  • 2,747
1 vote
2 answers
151 views

Android app Publish Error

I am getting this Error when I try to publish this app in the store to an update of existing app. I am using Visual studio Apache Cordova Tools to build the apk and the previous version was published ...
Sudarshan Anbazhagan's user avatar
3 votes
0 answers
969 views

Android Espresso Test: java.lang.TypeNotPresentException: Type org/powermock/modules/junit4/PowerMockRunner not present

I'm trying to use Powermock to mock static methods on Android Espresso Tests Cases, but I'm receiving this error. My tests are running fine with AndroidJUnit4.class Runner and I am able compile them ...
Igor Regis's user avatar
1 vote
1 answer
118 views

find code for classpath in gradle

In Android Stdio,We can see as following. classpath 'com.android.tools.build:gradle:1.5.0' I know that the this code is for gradle dependencies with jar. But I cannot find the this jar locally. How ...
罗路遥's user avatar
  • 185
-1 votes
5 answers
151 views

I created an HttpURLConnection but how do I parse the data?

I created an HttpURLConnection between a server. It is shown below public class SimpleHTTPRequest { public static void main(String[] args) { HttpURLConnection connection = null; ...
eli's user avatar
  • 335
0 votes
1 answer
157 views

view.setChocieMode(CHOICE_MULTIPLE_MODE)

public class MainActivity extends ListActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); ...
Talha Malik's user avatar
0 votes
1 answer
934 views

Not able to write file on external storage

i want to write file on external storage but it gives me error: java.io.FileNotFoundException: /mnt/media_rw/sdcard1/Backup/Contact/18-03-2016 16:03:17.vcf: open failed: EACCES (Permission denied) ...
user avatar
2 votes
3 answers
5k views

Moving view pager to first item when the end of view pager is reached

Following is my instantiateItem method @Override public Object instantiateItem(ViewGroup container, int position) { View itemView = mLayoutInflater.inflate(R.layout.pager_item, container, ...
user avatar
7 votes
3 answers
5k views

Is it ok to check legality of installing paid android app by checking getInstallerPackageName?

To ensure that my paid android application was legally installed from store, I write this: String installer = getPackageManager().getInstallerPackageName( "com.example.myapp"); if (...
Roman Shuvalov's user avatar
0 votes
3 answers
1k views

the scrollView not working in fragment android

I developed an android application in which the scroll-view is not scrolling.. I am posting the code here please check and if found any error please help.. Here I used ScrollView as root and then ...
aroma's user avatar
  • 21
-1 votes
2 answers
46 views

android Activities classes and objects

I am new to android development. So I have a question about activities. On Google developer, they say you have to make a class which is inheriting from the class Activity. So far so good. Now I am ...
user5674810's user avatar
0 votes
1 answer
83 views

null pointer exception on arrayadapter when trying to display the list [duplicate]

So I have an activity in which it gets an XML file through a web service. It reads the XML and stores the relevant texts from that XML to a List<String> object called xmlText. After retreiving ...
Tarikh Chouhan's user avatar
0 votes
0 answers
132 views

SocketTimeoutException in android when trying video streaming

I am trying to make a video streaming application between pc and android device. so I am getting this error "SocketTimeoutException" private class ChatOperator extends AsyncTask<Void, Void, Void&...
ahmed ashraf's user avatar
0 votes
4 answers
3k views

How to update listview immediately after data insert to SQLite

I have class called Custom which extend fragment. OnCreateView it will call populateListView method in the same class by passing in view v into it. onClicking the fab buttom, it will open a new ...
Simon Ho's user avatar
  • 598
2 votes
2 answers
537 views

How to get lat long after arcgis mapview scroll in android?

I am using Arcgis mapview Api in android.There is a pin we have added at the center of the screen. I want to get the coordinate for the location that comes under that pin when i scroll the map.Please ...
Parveen's user avatar
  • 103
0 votes
3 answers
312 views

Android Email validation with "@"

Is it possible to get an E-Mail validation in my code: EditText EmailAdresse = (EditText) findViewById(R.id.editTextEMailAdresse); if (EmailAdresse.getText().toString().length(...
Chris's user avatar
  • 3
1 vote
1 answer
1k views

How to detect android headset button click on 4.0 and higher

I am trying to detect Headset button click referring to this http://android.amberfog.com/?p=415 This is the code I haave tried public class MainActivity extends Activity { private IntentFilter ...
1234567's user avatar
  • 2,405
0 votes
4 answers
573 views

Error:(4) No resource identifier found for attribute 'id' in package

I am getting this error for the menu item I have added for the toolbar. <?xml version="1.0" encoding="utf-8"?> <menu xmlns:android="http://schemas.android.com/apk/res-auto" xmlns:xmls="...
Savita's user avatar
  • 747
1 vote
2 answers
3k views

Android-21 static build of libcurl with OpenSSL

I have a library written with C++11 (thread, smart pointers). For HTTP support this library uses libcurl with openssl for HTTPS support. Before this lib had to work only at Windows and iOS. But I got ...
John Green's user avatar
0 votes
2 answers
197 views

Android studio get distance in every 5s

No bug, but the distance keeps changing when i click test button(not every 5s), so i dunno if my code really works well or not. It would be appreciated if you can tell whether there is some logical ...
user avatar
0 votes
1 answer
226 views

AndroidPay unrecoverable error in onActivityResult

I'm trying to use the AndroidPay API. I set the environment to WalletConstants.ENVIRONMENT_SANDBOX but when I click the Pay button in the onActivityResult my errorCode is 8, and it returns the ...
Tooroop's user avatar
  • 1,854
2 votes
0 answers
237 views

Android widget's onUpdate() method calls before the ConfigurationActivity

Android widget's onUpdate() method calls before the ConfigurationActivity and so I receive black screen instead of config screen. Here is my code. public class WidgetConfig extends Activity { ...
DrHolera's user avatar
  • 199
2 votes
0 answers
146 views

Mpandroidchart last value xlabels

Is there any way to show the last value of the xlabel at the end of the x-axis? For example: I want to put the value 20:01 at the end of the x-axis. Thanks in advance.
Carlos Hernández Gil's user avatar
5 votes
3 answers
6k views

Recyclerview not populating with data after orientation change

I have a recyclerview having different layouts for portrait and landscape. When the activity starts, the recyclerview populates with data irrespective of the orientation. But if the orientation is ...
suku's user avatar
  • 10.7k
6 votes
1 answer
4k views

Does Device Owner app get System App permissions?

I'm trying to put some pieces together regarding the Device Owner application. With regards the the newly released EMM API, is there a way for the Device Owner application get system app permissions? ...
Martin Rončka's user avatar
0 votes
3 answers
789 views

Edit text value duplicates in list view while scrolling

I am new to android. when I was inserting value to the edit text in the list view it gets duplicates while scrolling. I searched everywhere but i could n't find exact solution. my list view is very ...
ellie's user avatar
  • 11
-2 votes
1 answer
61 views

regular expression split in java [closed]

I receive problem with split by regular expression in Android. For example: I have string: "Bin and Ban [droveǀhad driven] to London together after they [had pickedǀpicked] up the company car on ...
smail2133's user avatar
  • 944
1 vote
1 answer
386 views

Click Event not working for linearlayout in android

I am facing problem in which i am using listview extending Baseadapter in which i need to click Linearlayout but i am not getting its clickevent. Here is my layout and my adapter class. <...
mohammedali sunasara's user avatar
2 votes
0 answers
102 views

Sending Quotes through Intent

I have asked this question before but up till now, I still can't get answer. I am creating an quotes App, that the quotes will be send to Whatsapp, imo, and this is my line of Code.. int selector; ...
Obadimeji Olaonipekun's user avatar
0 votes
5 answers
107 views

Aligning two textviews in a listview

Here's what I have: There are options and there are content to every option. Option numbers (A, B, C, D) are in a separate textview and their contents are in a separate textview. All I'm trying is ...
Akeshwar Jha's user avatar
  • 4,556
0 votes
2 answers
58 views

Getting same value while comparing 2 arraylist

I can able to fetch json response , added response in arraylist When i try to compare 2 arraylist , arraylist2 value is not changing. what i have done : json parsing : for (int i = 0; i < array....
tiger's user avatar
  • 413
1 vote
0 answers
139 views

Scheduling Repeating Local Push Notification for Birthday Android

Calendar calendar = Calendar.getInstance(); //set notification for date --> 8th January 2010 at 9:06:00 PM calendar.set(Calendar.MONTH, 0); calendar.set(Calendar.YEAR, 2010);...
Amlan Mohapatra's user avatar
1 vote
1 answer
3k views

Fetch Data from JSON using volley in Fragment

I am trying to get data from a URL using volley everything is alright(no errors) but i can't see anything on opening the fragment not even progress dialogue. You can find the reference here: Custom ...
Sky's user avatar
  • 33
1 vote
0 answers
525 views

Android Marshmallow permission is not granted, when Notification present on the screen

I have a trouble with Marshmallow permissions usage together with Notification. Every time when I receive SMS notification (or similar) And if Request Permission Dialog present on the same time on ...
Sergey Shustikov's user avatar