0

I am working with android app.Since I am new to android development, I completed my recipe app using diff XML file. I used each XML page for each item and it can be selected using the list activity. But it seems to be large memory size . How can I reduce this memory ?? Or is there any other method without using diff XML for each one ??? please help me and thanks

2 Answers2

1

you can define all view at runtime..

so it will consume memory.

AndyBoy
  • 564
  • 6
  • 29
  • how can i do this?? please explain I am in just learning stage of android –  Nov 07 '13 at 07:35
  • go this links [this](http://stackoverflow.com/questions/5763366/how-to-create-multiple-buttons-at-runtime-android) – AndyBoy Nov 07 '13 at 08:03
  • go this links [this](http://stackoverflow.com/questions/5763366/how-to-create-multiple-buttons-at-runtime-android) `[this]`(http://stackoverflow.com/questions/2693744/android-runtime-layout-tutorial) `[this]`(http://stackoverflow.com/questions/6583019/dynamic-textview-in-relative-layout) `[this]`(http://stackoverflow.com/questions/15261811/dynamically-adding-linearlayouts-in-android) `[this]`(stackoverflow.com/questions/7354034/dynamically-add-a-textview-android) `[This]`(stackoverflow.com/questions/9509842/how-to-add-a-dynamically-created-linearlayout-to-a-scrollview) – AndyBoy Nov 07 '13 at 08:09
0

you can make all the views at the run time. and if some activities has same layouts you can use one layout for all that activities.

Try to generate all the layouts values dynamically. It will reduce size as well as helps to maintain the app for future updates.

Mohit Rakhra
  • 114
  • 1
  • 15
  • I am trying to load images from drawable to the same imageview for diff actions .is it posiible ?? show me an example if you dont mind thank you –  Nov 07 '13 at 08:00
  • You please put some code as an sample of what you are actually doing. If will be a good way to help you out in this – Mohit Rakhra Nov 07 '13 at 08:29