How to make a small change to Android source code, and incorporate into your own project -


i want make small change android standard timepicker class. specifically, i'm trying change works in 15 minute increments, rather 1 minute increments.

this post helped me constrain range of minute values {0, 15, 30, 45}, required in app. pointed out in follow comment, minute spinner still shows previous minute current value - 1, , next minute current value + 1, creates sloppy-feeling user interface.

i looked relevant android source code, , appears changes need make pretty simple. when tried copying source code project got zillion errors relating package declaration, find widget, how resolve r.id variables, etc.

so question is:

what's best way make small change given class android source code, , incorporate own project?

in case, need make few small changes timepicker , numberpicker, i'm not sure how set in project.

thanks suggestions.

but when tried copying source code project got zillion errors relating package declaration

your source file's directory needs match package name. , since cannot overwrite android.widget.timepicker, either need move class new package or give new name.

where find widget

that implies copied timepicker 1 of packages. fine, need add in appropriate import statements classes timepicker referred original package. or, need keep (renamed) timepicker in android.widget, adding package project. rudimentary java.

how resolve r.id variables

if timepicker relies upon resources not part of android sdk, need copy resources aosp project well.

what's best way make small change given class android source code, , incorporate own project?

imho, cannot answered readily in abstract. speaking, sorts of things listed above.


Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -