request max heapsize?

by Tomasz » Sun, 15 May 2011 00:31:20 GMT


Sponsored Links
 Hi guys,

Is there a way for an application to request a larger than normal
maximum heap size? I have an application which needs around 100mb RAM
(and this is with lots of tricks to decrease memory usage).

Newer phones with 500mb+ should have no problem coping with this. Any
advice is very much appreciated.

Thanks,
Tomasz

-- 



Re: request max heapsize?

by Tomasz » Sun, 15 May 2011 00:59:58 GMT


 I have found some references to a manifest file attribute,
android:largeheap="true"
However if I try and use this I get the following error on
compilation:
error: No resource identifier found for attribute 'largeheap' in
package 'android'




-- 


Sponsored Links


Re: Re: request max heapsize?

by Harri Smæ°“tt » Sun, 15 May 2011 01:51:29 GMT


 



android:largeHeap="true" is mentioned here;
 http://developer.android.com/reference/android/app/ActivityManager.html #getLargeMemoryClass%28%29

It's API level 11 method, could it be so that this attribute is too?

--
H

-- 



Re: Re: request max heapsize?

by Dianne Hackborn » Sun, 15 May 2011 02:27:03 GMT


 Yes this was introduced in 3.0.

2011/5/14 Harri Smtt <har...@gmail.com>






-- 
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.

-- 



Other Threads

1. Would you at least give us names

I know you have plans, but at least share with us who won in round 1.
Some of us have plans and need to know if they lost so they can start
selling their app or otherwise wait and keep their app free.
Instead of keeping thousands of users in the dark, announce the 200
and let others start planning.

This is really annoying, it's been almost three weeks and you won't
give information, you're delaying the release of the thousands of
application because of this! most developers will be annoyed when they
find out they lost and that they were waiting in vain.


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

2. OnLocationChanged never called

Hello there! I'm trying to create a simple app to test GPS
integration. Using the emulator and geo fix commands from telnet I'm
able to get it working as expected. But installing it on a device,
when I click on the first button to start listening for updates I can
see the the GPS is active (by the small radar icon) but, moving
around, It never updates the textfields it were suppose to update.

Any ideas?

package com.furiousbob.android.gps;

import android.app.Activity;
import android.content.Context;
import android.location.Location;
import android.location.LocationListener;
import android.location.LocationManager;
import android.os.Bundle;
import android.sax.TextElementListener;
import android.util.Log;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;

public class MainActivity extends Activity {
    /** Called when the activity is first created. */

      private boolean amIListening = false;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        Button btn = (Button)this.findViewById(R.id.Button01);
        Button btn2 = (Button)this.findViewById(R.id.Button02);


        final LocationManager lm = (LocationManager)getSystemService
(Context.LOCATION_SERVICE);
        final LocationListener gpsListener = new MyGPSListener(this);

        btn.setOnClickListener(new OnClickListener() {

                        @Override
                        public void onClick(View v) {
                                if(!amIListening){
                                        lm.requestLocationUpdates("gps", 5000, 
0, gpsListener);
                                        amIListening = true;
                                }
                        }
                });

        btn2.setOnClickListener(new OnClickListener() {

                        @Override
                        public void onClick(View v) {
                                if(amIListening){
                                        lm.removeUpdates(gpsListener);
                                        amIListening = false;
                                }

                        }
                });
    }

    private class MyGPSListener implements LocationListener{

        private Activity activity;

        public MyGPSListener(Activity parent){
                this.activity = parent;
        }

                @Override
                public void onLocationChanged(Location location) {
                        Double lat = location.getLatitude();
                        Double lon = location.getLongitude();
                        Double alt = location.getAltitude();
                        
((TextView)activity.findViewById(R.id.TextView01)).setText
("Latitude: " + lat);
                        
((TextView)activity.findViewById(R.id.TextView02)).setText
("Longitude: " + lon);
                        
((TextView)activity.findViewById(R.id.TextView03)).setText
("Altitude: " + alt);
                }

                @Override
                public void onProviderDisabled(String provider) {
                        // TODO Auto-generated method stub

                }

                @Override
                public void onProviderEnabled(String provider) {
                        // TODO Auto-generated method stub

                }

                @Override
                public void onStatusChanged(String provider, int status, Bundle
extras) {
                        // TODO Auto-generated method stub

                }

    }
}
--~--~---------~--~----~------------~-------~--~----~

3. Modular packaging - Queries

4. ContentResolver in a Service

5. Will Android apps every make proper money ...

6. make seekbar (un)clickable depending on RadioButton

7. ListViews in tabs