Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Porting a 100 Activities app to Fragments without dying

I have developed a huge app for a bank. This app gives the user the ability to perform a big bunch of operations through the phone (national & international transfers, securities, stock market values, alerts, deposits, card changes, card activations, checks, etc, etc).

All the app is running Android native code, and each screen is an Activity.

Now we are moving to Fragments... I have the way to go based on these tutorials this and this... I have even optimized their process.

But still, based on their suggestions I will have to create about 100 new Fragment classes; switch the code I had on per-screen Activities and put it inside those new per-screen Fragment classes; update about 100 layouts; and finally update the way screens trigger new screens (use of FragmentManager instead of Intents).

Maybe not difficult tasks, but tedious.

My question is, anyone know a fast way to port a 100 Activities app to Fragments faster than the one suggested on mentioned tutorials?

Thx

like image 682
Axel M. Garcia Avatar asked May 11 '11 15:05

Axel M. Garcia


People also ask

Can we have fragments without activity?

Fragment can't be initiated without Activity or FragmentActivity.

Can one activity have multiple fragments?

We can use one to multiple fragments in a single activity. Based on the app requirements, we might use fragments in our app or we might not use and cover the most of the screens using Activity classes. Fragments are now widely used in Android apps after adopting Navigation components.


1 Answers

Ok, thanks to the new capability of Android Market now its not necessary to re-implement and old application to make it suport both (Fragment and not Fragment). You can upload more than one APKs.

So you can just create a new vanilla version customized for tablets. If your application is too big this will be faster than re-factor the whole application.

like image 51
Axel M. Garcia Avatar answered Oct 21 '22 18:10

Axel M. Garcia