Back-porting from Android 2.0 to Android 1.5

by AJ » Tue, 08 Dec 2009 07:06:23 GMT


Sponsored Links
 I have read the website and archives on backporting (building on SDK
2.0 to run on SDK 1.5) and it seems consensus is to change the minimum
SDK version required in the manifest (from 5 back to 3) and check for
any private API calls. I've done that, but I have two remaining
concerns. [Note: I wrote/built this app on 2.0 with emulators without
access to an Android 1.5 device.]

1) drawable verses the new drawable-* ... if I don't have an icon in
drawable.png will my application be icon-less in 1.5? Do I need to
copy one of the new icons in there? If so, which one?

2) search ... how does the "SEARCH" activity get raised for an
application on SDK 1.5 devices (which don't appear to have a hardware
search button.) Do I need to add a menu option and raise SEARCH as a
sub-activity? [Note: I am 100% confused by search button on all
android versions 'cos what I read says SDK 2.0 copes with virtual
buttons, yet those devices (in emulator) seem to have hardware ones.
What am I missing?]

Thanks in advance for help with these. Please let me know if there are
any more issues I am missing.

--



Back-porting from Android 2.0 to Android 1.5

by Dianne Hackborn » Tue, 08 Dec 2009 07:26:30 GMT


 



If you want to run on pre-1.6 platforms, I would suggest putting your medium
density bitmaps in drawable/* instead of drawable-mdpi/*.  1.6 and later
will assume that these are medium density.



Whether or not there is a search button is really a device thing, and not a
platform version thing.  For example, the G1 has a search key on its hard
keyboard, and you can assume there will be devices running 2.0 and later
that don't have a search key.  If search is important for your app, you will
want to have another mechanism to get to it -- often a menu item.

-- 
Dianne Hackborn
Android framework engineer
hack...@android.com

Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.

--


Sponsored Links


Back-porting from Android 2.0 to Android 1.5

by theSmith » Wed, 09 Dec 2009 00:20:59 GMT


 Should we just create our own search activity or is there one
available in 1.5?  As far as I know the global search feature is only
1.6+.

When creating our own activity, how would we capture the search key
(hard) being pressed on a device?

-Chris






--



Back-porting from Android 2.0 to Android 1.5

by AJ » Thu, 10 Dec 2009 17:10:34 GMT


 n Dec 7, 4:25pm, Dianne Hackborn <hack...@android.com> wrote:
Thank you.


Thanks, again, that helped a lot. I've added a menu option (although
I'd love to know how to hide that if I could detect a hardware
button.)

My remaining problem is the search suggestion provider code (which I
took from a 2.0 sample) will compile on SDK 1.5 (I've built a SDK
project to ensure little is hidden by backwards compatibility.)
Anyway, things seem good unless I actually return search suggestions
via a

/**
* The columns we'll include in our search suggestions. There are
others that could be used
* to further customize the suggestions, see the docs in {...@link
SearchManager} for the details
* on additional columns that are supported.
*/
private static final String[] COLUMNS = {
"_id", // must include this column
SearchManager.SUGGEST_COLUMN_TEXT_1,
SearchManager.SUGGEST_COLUMN_INTENT_DATA,
};

The generation is here:

MatrixCursor cursor = new MatrixCursor(COLUMNS, 0);
for (String ingredient : matching_ingredients) {
cursor.addRow(new String[] {
ingredient, // _id
ingredient, // text1
ingredient // intent_data (included when
clicking
on item)
});
}


I've tried reading SearchManager documentation, but cannot seem to
track down what columns it is expecting (or not expecting) for SDK 1.5
that causes it to try to get a long when I don't have one.


Unless I comment that out, I get:

12-08 12:02:21.263: ERROR/AndroidRuntime(808):
java.lang.NumberFormatException: Achee
12-08 12:02:21.263: ERROR/AndroidRuntime(808): at
java.lang.Long.parse(Long.java:368)
12-08 12:02:21.263: ERROR/AndroidRuntime(808): at
java.lang.Long.parseLong(Long.java:358)
12-08 12:02:21.263: ERROR/AndroidRuntime(808): at
java.lang.Long.parseLong(Long.java:323)
12-08 12:02:21.263: ERROR/AndroidRuntime(808): at
java.lang.Long.valueOf(Long.java:570)
12-08 12:02:21.263: ERROR/AndroidRuntime(808): at
android.database.MatrixCursor.getLong(MatrixCursor.java:245)
12-08 12:02:21.263: ERROR/AndroidRuntime(808): at
android.database.CursorWrapper.getLong(CursorWrapper.java:127)
12-08 12:02:21.263: ERROR/AndroidRuntime(808): at
android.widget.CursorAdapter.getItemId(CursorAdapter.java:156)
12-08 12:02:21.263: ERROR/AndroidRuntime(808): at
android.widget.AutoCompleteTextView.buildDropDown
(AutoCompleteTextView.java:900)
12-08 12:02:21.263: ERROR/AndroidRuntime(808): at
android.widget.AutoCompleteTextView.showDropDown
(AutoCompleteTextView.java:843)
12-08 12:02:21.263: ERROR/AndroidRuntime(808): at
android.widget.AutoCompleteTextView.onFilterComplete
(AutoCompleteTextView.java:749)
12-08 12:02:21.263: ERROR/AndroidRuntime(808): at
android.widget.Filter$ResultsHandler.handleMessage(Filter.java:266)
12-08 12:02:21.263: ERROR/AndroidRuntime(808): at
android.os.Handler.dispatchMessage(Handler.java:99)
12-08 12:02:21.263: ERROR/AndroidRuntime(808): at
android.os.Looper.loop(Looper.java:123)
12-08 12:02:21.263: ERROR/AndroidRuntime(808): at
android.app.ActivityThread.main(ActivityThread.java:3948)
12-08 12:02:21.263: ERROR/AndroidRuntime(808): at
java.lang.reflect.Method.invokeNative(Native Method)
12-08 12:02:21.263: ERROR/AndroidRuntime



Back-porting from Android 2.0 to Android 1.5

by theSmith » Wed, 16 Dec 2009 14:20:14 GMT


 Diane

My mistake, since I started developing when 1.6 was released I thought
the search manager was the new QSB from 1.6

@AJ

My app is crashing too because of the QSR terms in the searchable.xml
The problem then becomes how can you access them from 1.6+ without
them being seen in 1.5?

On Dec 8, 2:13pm, AJ <adam.j...@gmail.com> wrote:

--



Other Threads

1. Android OMAP 35X EVM

Hi

I am planning to port Donut on Android OMAP 35X EVM .While downloading
the android source code which xxxmanifest.git i need select, so that
the android images generated are easily portable.

Regards
Sunil
--~--~---------~--~----~------------~-------~--~----~
unsubscribe: android-porting+unsubscr...@googlegroups.com
website: 

2. OpenGL Implementation and texture sharing

I am beginning to suspect that texture sharing is not supported.
Looking at the source code there are two possible native
implementations libagl and EGL... how do these relate to each other?

frameworks/base/opengl/libagl/egl.cpp
frameworks/base/opengl/libs/EGL/egl.cpp

Is the implementation of texture sharing dependent on an OpenGL
driver? How can I tell if it is implemented? As far as I know, texture
sharing is not an option feature in OpenEL-ES 1.0.

Does anyone on this list know how Android implements OpenGL-ES, or
where else to ask?

Regards,
Keean.

--~--~---------~--~----~------------~-------~--~----~

3. how to make a little time stop between two works

4. Take a long time to make call

5. Inserting large volumes of data into SQLite - speed issues

6. Localization of Apps: Thai & Vietnamese

7. How do I delete an app from 'All Android Market listings'?