Question

When trying to port JB launcher to GB, I've got a lot of errors related to new APIs. I've added support library rev. 9 - and nothing changed, I'm getting about 1 000 errors. Is there a way to backport it without rewriting it's code?

Was it helpful?

Solution

Take a look at the errors you're getting, then check some of them against the online API reference see if they are newly added.

Take a look at the drop down menu, next to where it says "Android API", where you can choose your target API level. Choose API Level 7 (Gingerbread), and then look up the "errors", and see if they're just added functionality.

Then, check that the support library is being imported correctly. If your code is using fragments, for example, it could be targeting packages in the new API, instead of the support library. To do this easily, try Ctrl+Shift+O to automatically import any new things. Watch out though; sometimes it can import the wrong things, or delete imports it says "aren't used", because the lines where you use that import are seen as errors.

There will be cases where you'll certainly have to rewrite things; but if you do everything you can before starting to rewrite, you may save yourself a lot of time.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top