Click here to Skip to main content
15,890,438 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
i want to get Avd's Width ( android virtual device )
i use this code for my problem :

Java
Toast.makeText(this, String.valueOf(view.getWidth()), Toast.LENGTH_LONG);


but Eclips shows me an error.
view cannot be resolved ...

should i import somthing else in my acction ?

Java
import android.os.Bundle;
import android.widget.Toast;
import android.app.Activity;
import android.view.Menu;
Posted
Comments
Sergey Alexandrovich Kryukov 23-Sep-14 13:46pm    
I hope width of device is documented in manufacturers specs. Probably, your application could search for the specs on the Web and extract these figures from them using Web scraping. But functionality of your application should not depend on that size, maybe only on the size of the screen. :-)
—SA

1 solution

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900