500865

1

votes
2

answer
3.3k

views

Android - Custom CheckedTextView in listView doesn't get checked on click/disables SINGLE_CHOICE mode

When I use the layout from : android.R.layout.simple_list_item_single_choice as list item, the checkbox gets checked on click and everything is fine. However when I use the layout : The checkbox won't get toggled. If I implement an onClickListener like this in the list adapter : ((CheckedTextView)...
500865
1

votes
1

answer
1.5k

views

Android Maven : LifecycleExecutionException

This is the stack trace of the error which Is thrown when I do mvn install : [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 15.511s [INFO] Finished...
500865
1

votes
2

answer
1.1k

views

Android(<=2.2) Large File Downloads using android market apk expansion downloader library

Has anyone tried using market apk expansion downloader library (available as an add-on) for downloading large files on android
500865
1

votes
1

answer
990

views

Escape Codes in GSM 03.38 Encoding Scheme

I am working on an android sms gateway project which receives sms from client app from different countries. In the client app I use {, }, [ and ] for identifying the beginning and ending of some portion of the message which is sent as SMS to the gateway. As given in this link, these characters are s...
500865
18

votes
2

answer
842

views

Android : Consequences of having targetSDK > BuildTarget

I wanted to know the consequences of having targetSDK > buildTarget. I recently observed that if I keep the buildTarget=16 and targetSDK=17 the tabs on my tablet (running 4.1.1, API Level 16) moves to the center of the actionBar. I was unable to rationalize the behavior. Can somebody shed some light...
500865
2

votes
4

answer
317

views

How do I make unpushable commits pushable?

Master Branch had commits like this : A -> B -> C(HEAD) . HEAD was at C. What I did : I checked out B and made commits on top of it. Now the tree looks like this : A -> B -> C(master)(origin/master) | | -> B1 -> B2(HEAD) git status on the project directory is giving me the following message : # N...
500865
2

votes
3

answer
8.8k

views

Android Test Project - Reading assets file to test plain java object

My project setup Library Project A Contains a fooJSONParser like this : public class fooJsonParser { ... // Constructor using the input-stream public DPNodeJsonParser(InputStream inputJsonStream) { // Constructor } /** * Method that has to be executed once the class is instantiated to parse */ publi...
500865
3

votes
3

answer
4.6k

views

Android : Notification not working on 2.3.6 (Samsung galaxy y)

The following code has been confirmed to work fine on devices running HONEYCOMB+. However on Samsung galaxy Y it is not producing any notifications. String tickerText = userString + ' Download Queued'; Notification notification = new NotificationCompat.Builder(this).setAutoCancel(true) .setContentT...
500865
12

votes
2

answer
18k

views

Android - Proguard duplicate zip entry error

I am trying to use proguard in an android application which uses a android library project and I am getting the following error : java.io.IOException: Can't write [/private/var/folders/Pg/PgUpPJQ-E5qxL7jX6kpdCE+++TI/-Tmp-/android_3140050575281008652.jar] (Can't read [[email protected]
500865
13

votes
3

answer
6.1k

views

DynamoDB - Global Secondary Index on set items

I have a dynamo table with the following attributes : id (Number - primary key ) title (String) created_at (Number - long) tags (StringSet - contains a set of tags say android, ios, etc.,) I want to be able to query by tags - get me all the items tagged android. How can I do that in DynamoDB? It ap...
500865
3

votes
3

answer
19.5k

views

Android - start an activity from command line using intent uri

I have an Activity A with the following intent filter I am basically trying the custom data scheme in intent filters as explained here To test whether the IntentUri launches the activity or not I'm trying to fire the intent using the following command through terminal : adb shell am start intent://s...
500865
3

votes
3

answer
241

views

Toolbar as self-managed ActionBar vs Toolbar as framework managed ActionBar

Alright, I am trying to understand what I would lose if I use Toolbar as a self-managed ActionBar and not use setSupportActionBar. AFAIK, all that ActionBar does is, provide placeholders for logo, navigation and menu items and also let Fragments add/customize the menu items. The same functionality...
500865
3

votes
2

answer
3.2k

views

JAX-RS/Jersey path parameter regex for a simple string

I am trying to match strings v1 and v2. For that, I am trying the following regex : ^v(1|2) (I also tried with $ which is probably what I need). When I test it in http://www.regextester.com/, it seems to work fine. But when I used it in JAX-RS path expression it doesn't work. The expression I use is...
500865
2

votes
4

answer
255

views

Java - Split by delimiters

Given ___, I want to extract A, B, C in an array. Basically _< is the starting delimiter and _> is the ending delimiter.
500865
13

votes
2

answer
2.3k

views

Is it possible to do this Android screen animation with a ViewPager?

I need to make 2 screens with custom animation like explained below : Screen 1 Screen 2 ----------------------------- ------------------------------ | | | | | | | |...
500865
3

votes
1

answer
360

views

Android Multipart SMSes - received separately

I am developing an SMS gateway application which receives the sms'es from the client app, performs some operation on it and uploads the data to the server. From the client app, when the message length grows beyond 160 Characters, I do a sendMultipartTextMessage after splitting the message using the...
500865
2

votes
2

answer
700

views

Android - Is the Application class instantiated when a BroadcastReceiver is called?

is the Application class instantiated when a BroadcastReceiver is called? I have some logic in the custom Application class which is needed before the logic in onReceive of a BroadcastReceiver is run. The documentation says the Context argument in the onReceive method is the Context in which the rec...
500865
7

votes
2

answer
1.6k

views

Android Proguard - IllegalArgumentException in Jackson's TypeReference class

Android application crashes if proguard is used for obfuscating. Below is the stacktrace. Caused by: java.lang.IllegalArgumentException: Internal error: TypeReference constructed without actual type information at a.b.a.g.b.(TypeReference.java:35) at a.c.d.q.(StdCouchDbInstance.java:22) at a.c.d.p....
500865
1

votes
2

answer
1.4k

views

How to run the api level 14 demos on gingerbread and lower devices

When I create a new Android Sample Project from eclipse with api level 14, add the compatibility library and try to run it on my gingerbread device. It gave the following error : Error Inflating Class SwitchPreference I just commented the SwitchPreference from the preferences xml file and was able...
500865
7

votes
2

answer
3.3k

views

Android Fragment - Using activity's loadermanager instead of Fragment's. Is it Ok?

Given a fragment which loads (a lot of) data from the database using a loader. Problem : I have a pager adapter which destroys the fragment when the user moves away from the tab holding it and recreates it when user gets back to that tab. Because of this recreation, a new loader is created everytime...
500865
3

votes
3

answer
2.2k

views

Android studio : call requires API Level 16 error

I'm getting the following error in Android studio. The sqlitedatabase.close() method is available since API Level 1 but the android studio ide fails to detect that.
500865
3

votes
2

answer
5.1k

views

Android SQLiteCursor - getString returned value from a null valued column

Cursor API tells that the behavior is defined by the implementation when a null valued column is tried to be accessed and If I go to SQLiteCursor, the behavior is not documented. Does the SQLiteCursor return a NULL or throw an Exception?
500865
3

votes
1

answer
428

views

getCurrentSizeRange() on Android earlier than 4.1

On Android API 16 (4.1 Jelly Bean) and later we have the method getCurrentSizeRange to get the range of width and height. How do I get the size range on versions earlier than 4.1? I tried to look into the source code to see how the range is computed. It is done differently on different Android versi...
500865
2

votes
1

answer
1.2k

views

Relative references to images inside a webview

I have hundreds of HTML files in my assets/content1/htmls/ folder. Image sources referred to inside the HTML files are in the folder assets/content1/images/. In the HTML files, relative paths to the images are used (e.g. ). But the images don't show up in the HTML files. After researching other SO p...
500865
2

votes
1

answer
332

views

Expressing an integer as a sum of integers with minimum variance

I want to know how I can express an integer as a sum of integers with minimum variance. For ex : 21 can be expressed as 6+6+6+3 or 6+5+5+5 or 18+1+1+1 or ..... But the set (6,5,5,5) has the minimum variance. I want to program in android which can do this, given an integer and the number of elements...
500865
2

votes
2

answer
922

views

How can I update a map inside a map?

I have a Map of Maps that looks like this: Map data; I want to update the inner map. Should I do the following everytime I want to update the innermap or is there any other direct/better way of accomplishing it? Map innerMap = data.get('outer_key'); innerMap.put('inner_key', value); data.put('outer_...
500865
26

votes
10

answer
39.9k

views

Error : <item> tag requires a 'drawable' attribute or child tag defining a drawable

I created a state-list selector file item_bg_selector.xml in the drawable folder like this : Then i define a style element wrap_content wrap_content @drawable/item_bg_selector Then I try to create an ImageButton like this : Eclipse keeps giving me the following error in the Event Details window :...
500865
4

votes
4

answer
2.7k

views

Android - <include layout=…/> returns error

I have a library project in which I define an action bar in layout file action_bar.xml like this : The corresponding style element is this : @id/action_bar_container fill_parent @dimen/title_height horizontal @drawable/action_bar_background When I try to include the action bar in another layout file...
500865
4

votes
2

answer
24.4k

views

android - changing the system settings of a rooted device from inside the app

I am trying to change the sms limit described here from inside the app. The app is assumed to be running on a rooted device. I'm using the RootTools to check if the device is rooted or not. I'm trying to figure out how to write the actual setting on to the settings.db. Any suggestion which could hel...
500865
3

votes
2

answer
559

views

Android - png resource converted to a ColorDrawable on android < 4.0

According to documentation here, A png resource should be converted to a BitmapDrawable. However I'm observing a strange behavior wherein a png file which has only black pixels in it is resulting in a crash because of ClassCastException (wrapped in InvocationTargetException) if I try to do the follo...
500865
4

votes
3

answer
1.5k

views

Android - Dashboard layout with a statelist background drawable only for the icon

I am trying to create a dashboard layout. It is different from the google i/o's dashboard in the sense that the background of the image icon and the text below the icon is different. In other words, the icon(image only) has a StateListDrawable for its background while the text has a transparent bac...
500865
4

votes
1

answer
1.6k

views

Android - Changing Positive Button Text of EditTextPreference's Dialog Programmatically

I am trying to change the positiveButtonText of Dialog in the `EditTextPreference. I have tried the following with no success : // The reference to the preference in the view heirarchy mUrlPreference = (EditTextPreference) getPreferenceScreen().findPreference(pref); // Add a textwatcher mUrlP...
500865
8

votes
1

answer
4.8k

views

Strange Behavior - VideoViewer Fragment not working with MediaController

I am trying to create a VideoViewer fragment. Below are the 2 cases I have tried and the observations. For both the cases the fragment's view is inflated from the following layout: Case 1: VideoView without media controller - works fine. Below is the code for the onActivityCreated method /* Initial...
500865
4

votes
1

answer
2.8k

views

Android manifest merge - Different launcher activity from library project

I have a library project which has the following structure : In the app project I want the merged manifest to be : Is it possible to achieve this using manifest merger feature? If I try to have in the base manifest file of the app project, I am getting the following error. Trying to merge incompati...
500865
5

votes
3

answer
838

views

Android maven - manifestmerger property

In ADT 20.0.0 (linked from here) the manifestmerger property (to include library project's manifest into the app project) was added. Is it possible to enable this property in maven builds? if Yes, how?
500865
3

votes
1

answer
1.7k

views

Sqlite - default timestamp to be `now + a few days`

I am trying to have a column holding the timestamp value whose default value is today + a few days. Could this be done during table creation time?
500865
2

votes
1

answer
1.3k

views

Android : getSupportLoaderManager().getLoader(id) doesn't return previously used loader

I have a piece of code like the following in say Activity A : private static final int LOADER_ID = 0x200; protected void onCreate(Bundle b) { ... ... Loader previousLoader = getSupportLoaderManager().getLoader(LOADER_ID); ... ... } Observation 1 : User changes the orientation of the device while Act...
500865
17

votes
2

answer
7.8k

views

Android - Having Provider authority in the app project

An android library project contains a few providers whose authority is defined like the following in a contract class : public static final String CONTENT_AUTHORITY = 'my.com.library.providers.tester'; private static final Uri BASE_CONTENT_URI = Uri.parse('content://' + CONTENT_AUTHORITY); Now there...
500865