How to identify memory limits per application in your Android device?
How to identify memory limits per application in your Android device. This solution require API level 11.
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");
}
}
Written by Ketan Parmar
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Android
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#