Chuyển đến nội dung chính

Kích thước icon cho app Android và công cụ tạo icon của Google

Để hiển thị chuẩn theo các size màn hình thì chúng ta sẽ theo các kích thước sau:
36 × 36 (ldpi) – Low
48 × 48 (mdpi) – Medium
72 × 72 (hdpi) – High
96 × 96 (x-hdpi) – x-high
144 × 144 (xx-hdpi)
192 × 192 (xxx-hdpi)
512 × 512 (Google Play store) -> Kích thước này để làm ảnh demo cho App khi upload lên store.
Khi tạo icon launcher cho app nếu tạo bằng các Launcher icon generator cửa Google thì khi cài vào điện thoại nó sẽ bé hơn so với các app khác vì google tự động cho thêm padding vào icon. Tránh điều này thì nên tự thiết kế bằng Photoshop sau đó dùng cái này để tạo thì sẽ to và đẹp hơn, nó tạo nhanh và đủ các kích thước chuẩn như bên trên kia. Nếu bạn muốn bo góc thì cũng làm bo góc ở trong photoshop trước sau đó mới dùng công cụ bên trên.

Kiến thức liên quan đến đơn vị đo trong Android:

  • pixel có thể hiểu là số điểm ảnh có trong 1 dot có hình vuông vì là ảnh bitmap mà. Ảnh đen trắng binary image thì 1 dot = 1 px = 1 bit (chỉ có trạng thái bit 1 hoặc 0). Đôi khi màn hình retina của Apple có thể chưa 9 px trong 1 dot.
  • dp (dip), pt, sp là đơn vị đo chiều dài vật lý.
  • pt giống dp nhưng có chiều dài bằng 1pt = 1/72 inch mà 1dp = 1/160 inch.
  • sp đơn vị đo dành cho font. dp cho height& width.
  • dpi là mật độ số pixel/inch: có ldpi, mdpi, hdpi, x-hdpi, xx-hdpi, xxx-hdpi

Nhận xét

Bài đăng phổ biến từ blog này

Get Current location using FusedLocationProviderClient in Android

Hello to coders, Previously we have taught you  how you get current location using GPS/Network Provider . Then android has revealed  FusedLocationProviderClient  under  GoogleApi . FusedLocationProviderClient is for interacting with the location using fused location provider. ( NOTE :   To use this feature, GPS must be turned on your device. For manually ask the user to turn on GPS, please check  next article ) So let’s get started for the tutorial for getting the current location. First, add a dependency for location by play services: implementation 'com.google.android.gms:play-services-location:15.0.1' Then define FusedLocationProviderClient: private FusedLocationProviderClient mFusedLocationClient; private TextView txtLocation; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout. activity_main ); this.txtLocation = (TextView) findViewById(R.id. txtLocat...

NHỮNG WIDGET THƯỜNG DÙNG TRONG FLUTTER

 https://baoflutter.com/nhung-widget-thuong-dung-trong-flutter/ Trong bài viết trước về  cách xây dựng màn hình ứng dụng Flutter , các bạn biết rằng các màn hình ứng dụng được tạo ra bởi các widget ghép lại với nhau. Vì vậy việc hiểu và sử dụng các Widget là rất quan trọng. Vì vậy trong bài viết này, tôi sẽ giới thiệu cho các bạn về những widget quan trọng trong Flutter. Hầu hết các Widget đều có các phần sau đây: + Đặc tính của Widget như : color, theme, height, weight, decoration, onTap, onPressed + Liên kết với các Widget khác với từ khoá: child, children, home hoặc body Ví dụ : 1 2 3 4 5 6 Container ( color : Colors . blue , height : 300 , weight : 300 , child : Text ( "Widget con" ) , ) Khi làm một số App cơ bản, bạn sẽ nắm chắc được cách sử dụng các Widget hay dùng. MaterialApp – Là widget rất liện lợi, cung cấp các widget cho việc xây dựng ứng dụng sử dụng thư viện Material Design UI của google. – Widget này được sử dụng trong hàm build đầu tiên của hầu hết các ứn...

Understanding the Android Application Class

Overview The  Application  class in Android is the base class within an Android app that contains all other components such as activities and services. The Application class, or any subclass of the Application class, is instantiated before any other class when the process for your application/package is created. This class is primarily used for initialization of global state before the first  Activity  is displayed. Note that custom  Application  objects should be used carefully and are often  not needed at all . Custom Application Classes In many apps, there's no need to work with an application class directly. However, there are a few acceptable uses of a custom application class: Specialized tasks that need to run before the creation of your first activity Global initialization that needs to be shared across all components (crash reporting, persistence) Static methods for easy access to static immutable data such as a shared network cl...