Questions tagged [android]

167424 questions
2

votes
3

answer
1.1k

Views

Joda time find difference between Hours

I have a date String: Thu, 15 Jan 2015, 9:56 AM I convert it into a date variable: Thu Jan 15 09:56:00 GMT+05:30 2015 using: String pattern = 'EEE, d MMM yyyy, hh:mm a'; try { date = new SimpleDateFormat(pattern).parse(getPref('refresh', getApplicationContext())); } catch (ParseException e) { //...
User3
2

votes
3

answer
4.3k

Views

Android add undo feature to finger paint example in api demo

hi i am trying to add undo feature to finger paint example given in API demo. but i am not able to achieve it. So far i have added all the path that are drawn in a list and redrawing it to the canvas except the last path. But it is not working. Any clue where i am going wrong. Edit #1: My Undo Metho...
Dinash
3

votes
2

answer
1.6k

Views

Android: Image upload to web-service loses EXIF data

Please help, I currently upload an image to my web-service which does have the EXIF data attached to it at time of upload. When it arrives on the server, it is minus it's exif data. Bitmap bmp = BitmapFactory.decodeFile(fullFileName); if (bmp == null) { //oh sugar, not cool continue; } ByteArrayOutp...
theiOSDude
4

votes
2

answer
2.6k

Views

Android, How can I make AVD smaller?

I have created an AVD with the following characteristics: Target: Android Honeycomb (API level Honeycomb) SD card size: 64M Skin: Built-in WXVGA But the problem is, when I run this ADV, size of it is more bigger than screen size of my laptop. Therefore, I don't have access to all screen of the AVD....
Hesam
2

votes
1

answer
454

Views

header of collapsible listview not refreshing using jquery mobile and cordova

I am building an app using Cordova and JQuery Mobile 1.4.3 which pulls data from a webservice. I have no problems attaining the data once cordova has loaded and updating the DOM. The data is presented within a collapsible list with each heading and view updated according to the data returned from t...
Nick
23

votes
2

answer
23.6k

Views

Android: how to add app to “Share via” list for camera picture

I am building an app that starts when a user takes a picture using their build-in Android camera, then taps the Share button, then chooses my app as the sharer, which is expecting an incoming path to the picture that was just taken, which it uses for processing. Question: how do I add an option to t...
Ian Davis
5

votes
1

answer
5.9k

Views

Android - converting pkcs12 certificate string to x509 certificate object for bks keystore

I am writing an android app that requires SSL certification for certain web requests. Unlike the options I see online about creating the keystore files using the cert file, I have to make an initial web request that returns the certificate as a string in a json response. The JSON data is formatted l...
calebisstupid
28

votes
5

answer
46.6k

Views

Pass ArrayList<? implements Parcelable> to Activity

I have searched a few topics but not found a solution to my problem. public class Series implements Parcelable { private String name; private int numOfSeason; private int numOfEpisode; /** Constructors and Getters/Setters have been removed to make reading easier **/ public Series(Parcel in) { Strin...
Adrian Jandl
15

votes
2

answer
6k

Views

Observable.combineLatest type inference in kotlin

I'm using RxJava2, Kotlin-1.1 along with RxBindings in my project. I have simple login screen with 'login' button disabled by default, I want to enable the button only when username and password edittext fields are not empty. LoginActivity.java Observable isFormEnabled = Observable.combineLatest(mUs...
blizzard
7

votes
1

answer
5.9k

Views

How to work with Tensorflow on Android platform?

Google has made the TENSORFLOW open source for developers.. Is there any way out for using this on android? The link is here TensorFlow. I would love to have some directions to work on this API.
RUTURAJ Raval
13

votes
1

answer
3.1k

Views

OCR library to recognize numbers on meter device

I need OCR library(preferably in Java), which will be able to determine digit visualized on meter devices. Please see image. I've tried some libraries in Java but they was not able to determine this kind of font. UPDATE 1: Tesseract and Asprise libraries failed to perform this task
narek.gevorgyan
5

votes
1

answer
6.5k

Views

how to Upload image into server in Android?

I am trying to Upload image Capture by Camera into server. server send response code = 200 but Image is not upload into server. Code is : private boolean uploadData() { int count = this.forumThreadsB.size(); for (int i = 0; i < count; i++) { if (isPhoto) message = 'Uploading Shared Items ' + (i + 1...
Prashant Kadam
2

votes
2

answer
3.9k

Views

Get Device time in UTC format regardless time zone

How i can get the local time of the device and convert it to global UTC format for my country ?
UBA_MobileTeam
2

votes
1

answer
1.4k

Views

Robolectric - RuntimeException Stub

I have a Robolectric test case written as public void setUp(){ mActivity = new CalcActivity(); ShadowActivity shadow = Robolectric.shadowOf(mActivity); //more code But i'm getting a RuntimeException : Stub! at the very start of the setUp method. java.lang.RuntimeException: Stub! at android.content...
Traxex1909
4

votes
1

answer
996

Views

Reveal animation when open dialog like Whatsapp?

I would like to open user info's dialog with reveal animation like how Whatsapp does. Any idea? Thank you in advance.
Khaled
2

votes
2

answer
2.6k

Views

Create Shortcut of our own application

I have just downloaded an application from the android market. When I have installed the application, at the same a time shortcut of that application has been created on the default desktop. So, my question is: how can we create a shortcut of our application at the time of installation?
Nirav
3

votes
1

answer
57

Views

How to elimimate over riding when using timer thread?

I am implementing an application using a timer. In the timer, I call a method to get an image from a server. Inside the timer, I also print the value of variable i, and increment it. After that I try to print i's value using logcat. But sometimes it prints like this: 1 2 3 4 5 5 6 7 7 7 7 7 8 9 10 1...
kiran
2

votes
1

answer
218

Views

Which API is used by the official Facebook for Android application?

I currently use the Graph API and it seems like it has many bugs. Example (Missing Posts): Query 'home' using the Graph API Explorer (with all permissions granted). Look at the posts shown in Facebook website or the Facebook Android application (both set to show recent posts first). Compare the res...
roee88
2

votes
1

answer
325

Views

Show all points on graph while panning along x axis

I am using achartengine(God bless the folks behind this) for data that my application is continuously receiving over a socket connection. The point are plotted against time which is my x axis. To achieve a moving graph i am having to remove items from the TimeChart if the count goes beyond 20. timeS...
Umesh
2

votes
3

answer
7.1k

Views

java.lang.IllegalArgumentException: parameter must be a descendant of this view Error

I have a strange Error with a ViewGroup. For my main View I use classes in this links ViewFlow project java.lang.IllegalArgumentException: parameter must be a descendant of this view at android.view.ViewGroup.offsetRectBetweenParentAndChild(ViewGroup.java:4153) at android.view.ViewGroup.offsetDescen...
Substitut
41

votes
1

answer
22.6k

Views

How to initialize Crashlytics in Fabric.io?

Looking for some help. I just upgraded my android app to fabric and now the app gives an error on this line: Crashlytics.start(getApplicationContext()); Gradle: error: cannot find symbol method start(Context) I tried commenting out that line, but then the crashes are not getting logged. How do I ini...
Nidhi Shah
6

votes
4

answer
6.9k

Views

Sqlite database lifecycle? It is deleted when the app is closed?

I'm following a simple tutorial that creates a class wich extends from SQLiteOpenHelper and creates a DB with one table and 5 rows. OK, but I need to understand some more about android Sqlite databases. For example, what happens if the app is closed or the phone is off? Is the database deleted? Than...
NullPointerException
2

votes
1

answer
1.8k

Views

Difficulty animating a RelativeLayout to shift size when its contents change

I have a RelativeLayout within which is a ScrollView and an EditText, and if a user shifts focus to the EditText I want the ScrollView to hide itself until they finish. That part was easy, but I also would like the RelativeLayout to shrink/expand gradually to present a nice transition, rather than s...
mikeappell
1

votes
3

answer
6.8k

Views

Android WebView Zooming using the ScaleDetector

HI, Is it possible to support zooming of a WebView (similar to the default browser) when the user pinches and moves their fingers closer / further away. Im using 2.2 and tought this would be possible using the ScaleGestureDetector. THe problem is that I can't seem to find a method to set the scale....
Bear
6

votes
2

answer
967

Views

Calling openOptionsMenu() in XE16 causes WindowManager.BadTokenException

I have a GDK app that worked fine in XE12 but now crashes in XE16 after transitioning to GDK:19. In particular, calling openOptionsMenu() in an Activity (in this case, to open an options menu on a Live Card) causes BadTokenExceptions. Logcat output: 04-16 03:36:43.197: E/AndroidRuntime(2465): FATAL...
Zack Freedman
2

votes
1

answer
3.7k

Views

Android R.anim,shake not found

I have followed the tutorial at: http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/view/Animation1.html The code is fine until I get to: Animation shake = AnimationUtils.loadAnimation(this, R.anim.shake); It would appear that R.anim does not exist, eclipse suggests...
Paul
4

votes
2

answer
2.4k

Views

React-Native: Downloading and uploading files from android webview

I am using the React-Native webview bridge module because I need its functions and now I am trying to make work the downloading and uploading files. For downloading I was sending a message with the url of the file and then using the Linking package to download in browser, unfortunately I was getting...
NinetyHH
2

votes
2

answer
1k

Views

Double # showing 0 on android

I'm embarrassed to ask this question, but after 45 minutes of not finding a solution I will resort to public humiliation. I have a number that is being divided by another number and I'm storing that number in a double variable. The numbers are randomly generated, but debugging the app shows that bo...
Dave
3

votes
3

answer
2.9k

Views

Where is the documentation for OpenGL ES 2.0 on Android?

The only place I can find documentation on OpenGL ES 2.0 for android is at https://developer.android.com/reference/android/opengl/GLES20.html and at the tutorials on their website. Where can I find an api that explains what the GLES20 methods do? The current api just lists them without any explanati...
CoderOfHonor
7

votes
4

answer
19.9k

Views

how to use android sliding up panel

I have downloaded the umano sliding up panel from https://github.com/umano/AndroidSlidingUpPanel Imported it into the workspace and added reference to it in my project. Next I copied and pasted the following into a new layout - Here is the Code : But I am getting an error unbound prefix. What is...
Opax Web
28

votes
1

answer
78.8k

Views

Set image from android.R.drawable in image view android

i know how to set image/icon from our res/drawable If we set it directly from the code: imageView1.setImageResource(R.drawable.android_green_3d); But we can also get the icon from android.R.drawable like this: imageView1.setImageResource(android.R.drawable.ic_menu_more); How to set image/icon in xm...
user430926
3

votes
1

answer
2.1k

Views

QR Code scanning android

I am using Zxing Barcode scanner app to scan bar codes using Intent intent = new Intent('com.google.zxing.client.android.SCAN'); intent.putExtra('SCAN_MODE', 'QR_CODE_MODE'); startActivityForResult(intent, 0); It works fine. I could get the result in onActivityResult. No problem. I dont want QRCode...
Seshu Vinay
3

votes
1

answer
3.1k

Views

LibGDX - How to clear the Screen

I'm trying to display 2 different screens, changing when the user touches the screen. So far with the code below the screens change but the text just keeps overlapping and piling up. I need to dispose of EVERYTHING on the screen before switching. One of the 2 similar pages(only the text is different...
Chris
3

votes
1

answer
2.3k

Views

How can I receive to socket input as hexadecimal?

I sent a GET message with socket. And I received response message as string. But I want to receive as hexadecimal. But I didn't accomplish. This is my code block as string. Can you help me ? dos = new DataOutputStream(socket.getOutputStream()); dis = new BufferedReader(new InputStreamReader(socket.g...
Fatih ELMA
2

votes
1

answer
2.3k

Views

:app:mergeDebugResources FAILED Error: java.util.concurrent.ExecutionException: com.android.builder.internal.aapt.AaptException

Jenkins returns me the following error when I run the gradlew assembleDebug. In Android Studio 3.0 I don't have this problem. Does anyone know the reason? AAPT err(Facade for 2147483181): \\?\C:\Windows\System32\config\systemprofile\.gradle\caches\transforms-1\files-1.1\appcompat-v7-25.3.1.aar\e9979...
Maicon Hellmann
1

votes
5

answer
7.1k

Views

Android convert String to HashMap

I have a string that is something like this: [ { '1':33 }, { '2':30 }, { '3':15 }, { '4':23 }, ...{ '9':17 },... { 'U':2 }, { 'V':22 }, { 'W':1 }, { 'X':35 }, { 'Y':6 }, { 'Z':19 } ] The structure is {'key':value}. I need to convert this to a table/HashMap so that I can fetch values based on the key...
sb_269
7

votes
3

answer
5.2k

Views

Having Android Problems with Sun javax jars

I have been working on a Android Web Services program that uses a number of classes from Sun's javax libraries. The eclipse IDE is barking 'Attempt to include a core class (java.* or javax.* ) in something other than a core library.' My application is an Android application and I am not creating a...
Steve Mansfield
5

votes
2

answer
1.1k

Views

Android activity stack size problems?

I have an application with lots of activities. Many of these activities can start others, so the user's expected to generate a quite large activity stack. I'm currently using the default activity launch behaviours. Does anybody know, if a large activity stack (like > 100) would be pose a problem? I...
Zsombor Erdődy-Nagy
1

votes
1

answer
2.5k

Views

Queries with empty values from parse.com

Somehow I couldn't find the answer to this. I am running a query to parse.com and want to download all of the rows that contain an empty value in one of my columns. ParseQuery query = ParseQuery.getQuery(Constants.myTestTable); query.whereEqualTo('MyColumn', ''); When I upload a csv to parse where...
user986047
8

votes
4

answer
2.8k

Views

Searchview not showing in Toolbar

I have actually a problem with my Searchview on the Support AppCompat v7 lib 24.0.0. The SearchView is not shown up no text and input text (look screenshot) The searchquery work perfect. Thats my menu And here my onCreateOptionsMenu; menu.clear(); inflater.inflate(R.menu.menu_search, menu); MenuItem...
Sebastian R.