Created
July 24, 2013 11:34
-
-
Save kpbird/6069796 to your computer and use it in GitHub Desktop.
How to identify memory limits per application in your Android device.
This solution require API level 11.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.example.androidnative; | |
import android.app.Activity; | |
import android.app.ActivityManager; | |
import android.os.Bundle; | |
import android.util.Log; | |
public class MainActivity extends Activity { | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.activity_main); | |
ActivityManager activityManager = (ActivityManager) getApplication().getSystemService(ACTIVITY_SERVICE); | |
Log.i("Test", "Large Memory Limit " + activityManager.getLargeMemoryClass() + " MB"); | |
Log.i("Test", " Memory Limit " + activityManager.getMemoryClass() + " MB"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment