- Android Shape Drawables Tutorial
- Have you ever wanted to reduce your Android application’s size or make it look more interesting? If yes, then you should try out ShapeDrawables.
- Why should you use ShapeDrawables?
- Are there any disadvantages?
- Let’s start coding
- Create a simple gradient ShapeDrawable in XML
- This is how Android apps will work in Windows 11
- How do Android apps work on Windows 11?
- What will Android apps look like on Windows 11?
- How can I get Android apps on Windows 11?
- Will Android apps have limitations on Windows 11?
- A year-old flagship might just give you the best bang for your buck
- Samsung needs to bring back its iPod competitor
- VoLTE: How to use it and why you should care
- These are the best rugged Android phones
- This is how we do android
Android Shape Drawables Tutorial
Nov 3, 2017 · 6 min read
Have you ever wanted to reduce your Android application’s size or make it look more interesting? If yes, then you should try out ShapeDrawables.
First, we will go over the advantages and disadvantages of the ShapeDrawables. Then we will create some Drawables that could be used in your app and lastly for the grand finale we will try to replicate a gradient as can be seen in the Spotify app/website.
Why should you use ShapeDrawables?
When you want to use PNG or JPEG images in your applic a tion, you have to provide multiple copies of the same image for different screen densities. That, of course, clutters your app with copies of the same image. Yes, sometimes that is the path we have to choose because we can’t use Drawables for every single case, but we can dramatically reduce our application’s size if we can use Drawables instead. ShapeDrawables are a series of commands that tell how to draw something on the screen. That is why they can be resized and stretched as much as we want, without losing any quality. We can recolor and manipulate them even when the app is running and use the same ShapeDrawable multiple times in our app. Since ShapeDrawables are a subclass of the Drawable abstract class, we can use them in methods where a Drawable is expected. Click for the documentation of the ShapeDrawable.
Are there any disadvantages?
Of course, just like I have mentioned before we can’t use them in every case. I have said before that ShapeDrawable class is a subclass of the Drawable abstract class. There are other subclasses as well and every one of them has its own use case. You can click here to check other Drawable types and figure out which one is right for your case. Another issue is that they took a bit longer to draw than a Bitmap since there is a lot of parsing and drawing going on behind the scenes. But I think that is not a huge problem if your Drawables are simple.
My opinion is that you should use Drawables (ShapeDrawables) wherever you can, because they are easy to modify and they don’t take much space.
Let’s start coding
First let’s take a look at a simple example and then we will recreate a gradient as can be seen in the Spotify app/website.
Create a simple gradient ShapeDrawable in XML
First create a new drawable resource file.
Right click on res/drawable > New > Drawable resource file > give your file a name > use shape as a root element > click Ok
Shape root element defines that this is a ShapeDrawable.
This is how the first example looks like:
Источник
This is how Android apps will work in Windows 11
Source: Nick Sutrich / Android Central
Windows is a platform we don’t talk a whole lot about on Android Central, but it’s freshly relevant to us again thanks to Windows 11. That’s because, thanks to a technology partnership between Intel and Microsoft, PC users will be able to run Android apps in Windows 11. Of course, running Android apps in Windows was possible via third-party software in the past — Bluestacks is the most popular resource here and can be used on Windows 10 — but having the functionality built right into the operating system is a more preferable route.
But how does it work, why would you want to use it, and what are the limitations of this new technology? We aim to answer those questions and more right here.
How do Android apps work on Windows 11?
Source: Nick Sutrich / Android Central
Existing ways of getting Android apps and games to run in Windows, like Bluestacks, work on an emulation level similar to console emulators. Emulators like Bluestacks run a virtual version of an Android device on your computer, represented through an application window within Windows. This virtual Android device works identically to how a physical device would — much in the same way that virtual servers in the cloud operate — so applications and games think that device is what you’re actually using.
Microsoft is building Android functionality into Windows in a way that appears more like a native solution than something like Bluestacks, but this solution is more akin to how Apple’s Rosetta platform functions on its computers. When Apple introduced the Apple M1 chip in its latest Macs near the end of 2020, it debuted Rosetta 2 alongside it.
Microsoft is building Android functionality into Windows so that appears more like a native solution than an emulator like Bluestacks.
To oversimplify things, Rosetta works as a translator for the Apple M1 chip so that it can understand x86 instructions — that’s the architecture that Intel-powered Macs use and the same that your PC uses, no matter if you run an Intel or AMD chip.
Similarly, Microsoft’s underlying technology in Windows 11, powered in part by Intel Bridge technology, also functions as a translator for ARM instructions — that’s the architecture that Android is built upon and what chips from companies like Qualcomm and Mediatek are built on.
Android apps have to be translated to run on an Intel or AMD processor, but they run all the same.
If you think about watching a video in a foreign language that’s being translated live by a person, there’s always a slight lag time in the translation. So naturally, the translator has to listen to the language being spoken, process and understand that language, and then present it to you in a language and structure that makes sense. Similarly, the translation required for an Android app to run inside of Windows 11 means an Android app in Windows will never run as efficiently as a Windows app built for Windows.
Just as x86 apps technically run more slowly on an Apple M1-based Mac than native code would, the performance of the M1 chip ensures you won’t ever notice. Similarly, the performance gulf between a PC processor and a mobile one in an Android phone means apps will almost certainly run better on your Windows 11-based PC, even if they technically run slower than native code would.
While Intel Bridge is a technology built into Intel processors, Windows Central’s Daniel Rubino spoke with Microsoft and was assured that all Windows 11-based PCs — no matter if your PC runs on an AMD or an Intel chipset — will run Android apps. Whether or not Intel-based PCs will see a performance boost isn’t yet known, but there is a distinct possibility.
What will Android apps look like on Windows 11?
Source: Microsoft
From the information we have so far, Android apps will look and behave similarly to a normal Windows app. Android apps can be found on the Start Menu and can be pinned to the taskbar. Android apps that are running will have an icon placed in the taskbar in the same way a normal Windows app would run.
Android apps will run in a resizable window, exactly how you would expect an app to appear within the Windows operating system. These windows can be moved around, resized, minimized, and even snapped using the new enhanced snap functionality within Windows 11. You can see the TikTok Android app snapped to the right third of the screen in the image above.
How can I get Android apps on Windows 11?
Source: Microsoft
When Windows 11 launches this Fall, Android apps can be obtained from the Microsoft Store found in the Start Menu. Microsoft is using Windows 11 to launch its new open app store, which allows developers to submit apps built in several different ways. That means apps don’t just have to be built around the UWP standard, but can now be Win32 or even APK — that’s the extension used for Android applications.
You’ll find Android apps listed in the Microsoft Store, but the files are stored on Amazon’s servers.
What’s more, Microsoft is now allowing developers to host their own apps or to use other content delivery platforms for updates and other downloads. Microsoft will be officially providing Android apps via the Amazon Appstore as part of this new system. Amazon has been running its alternative Android app store for the better part of the decade now and offers a compelling alternative to the Google Play Store for any Android device.
The process for obtaining apps is only slightly complicated at first, but Microsoft says it’ll be as transparent as a Windows-based app once you get it set up. For example, when you first try to install an Android app from the Microsoft Store in Windows 11, you’ll be directed to download the Amazon Appstore and sign in with your Amazon account.
From there, any Android app downloaded from the Microsoft Store will appear to come straight from that Microsoft Store, but the transaction will actually take place through the Amazon Appstore behind the scenes. Similarly, apps downloaded in this manner will use the existing Amazon Appstore ecosystem to process in-app transactions.
APKs can be directly sideloaded onto Windows, making Android apps more like EXEs.
While Microsoft is partnering with Amazon to deliver Android apps initially, the goal isn’t to provide exclusivity to Amazon. Instead, Microsoft said it would love to have additional Android app stores and ecosystems in Windows 11, such as Google Play and the Samsung Galaxy Store.
Additionally, Microsoft Engineer Miguel de Icaza said that APKs could be sideloaded directly onto Windows, meaning the Amazon Appstore won’t be an actual restriction on day 1, just the only official store to get Android apps and games from. This would, effectively, be no different from running or installing an EXE or MSI on an existing Windows 10 installation and significantly opening up the concept of Android apps within Windows 11.
Will Android apps have limitations on Windows 11?
Source: Nick Sutrich / Android Central
It’s not yet known how Android apps running on a Windows 11 PC will handle notifications, data syncing, or other crucial functions that Android users have come to love and expect from the Google Play ecosystem. Google Mobile Services, or more commonly known as GMS, is the star of the show behind the scenes. Android might be an open-source OS, but the glue that ties everything together is GMS, and Android wouldn’t feel the same without it.
Android apps from the Amazon Appstore don’t use Google services.
Android apps on the Amazon Appstore are designed to run on Android-powered devices, like the best Amazon Fire tablets, so it’s not likely you’ll find anything too out of place when running anything available from the Microsoft Store. Windows has had a modern notification system since Windows 10 debuted, and Windows 11 is designed to make that experience even better.
Some apps rely on syncing data between devices to deliver an optimal experience. Many Android apps use GMS to do this, enabling things like consistent notifications between Android-powered devices. Apps that rely on GMS to do this likely won’t function the same within Windows, meaning you could see duplicate notifications at times.
It’s also possible that apps and games that sync saved data with Google Drive (or via GMS in any way) may not be able to bring those saves over to your Windows 11-powered PC. Cloud-based services shouldn’t have this problem. It’s understood that Android apps should be able to access your Windows file system to read data, so it’s possible that some developers may use this as a workaround.
While the Amazon Appstore has thousands of apps available — including popular mobile-focused social networks like Instagram and TikTok — it’s also been known for having out-of-date apps. We’re not expecting this situation to change much initially, but it could see an improvement as more Windows users download Android apps.
A year-old flagship might just give you the best bang for your buck
In late 2021, a discounted 2020 flagship can still be a fantastic buy. Here’s why!
Samsung needs to bring back its iPod competitor
I don’t want to buy an iPod Touch. Since I want a reasonably priced PMP with acceptable audio hardware that can install a few crucial apps, I might have to.
VoLTE: How to use it and why you should care
VoLTE — or Voice over LTE — is the new standard for calling throughout the U.S., Canada, and parts of Europe. Not only does it facilitate much higher call quality between cell phones, but it allows devices to stay connected to LTE while on a call, improving data speeds for everyone.
These are the best rugged Android phones
Living the rough and tumble life? Get yourself a smartphone that can handle everything you throw at it — or throw your phone at.
Источник
This is how we do android
Пэрри и Блум обручились два года назад и планировали устроить пышное торжество в 2020 году. В планы вмешалась пандемия и церемонию с вечеринкой пришлось сперва перенести, а позже и вовсе отменить.
В марте 2021 года начала всплывать информация о все-таки состоявшейся тайной свадьбе звезд. Журналисты обратили внимание на обручальные кольца у Пэрри и Блума. Пара при этом продолжала хранить молчание и не комментировала предположения. О секретном торжестве журналу «Us Weekly» проговорился радиоведущий Бобби Боунс. Давний друг Орландо и Кэти слегка обижен, что не присутствовал на церемонии бракосочетания.
«Свадьба была настолько маленькой, что я не получил этого приглашения. Я, конечно, понимаю, почему так произошло, но все-таки немного ревную».
Для певицы и актера этот брак не первый. Орландо Блум был женат на Миранде Керр, у них есть 10-летний сын Флинн. Перри была замужем за Расселом Брэндом.
Роман Блум и Перри начался в 2016 году. Пара успела расстаться, сойтись и родить дочь Дейзи Дав, которой скоро исполнится годик.
Любительница покемонов не раз признавалась, что став матерью, ей катастрофически не хватает времени. Даже, чтобы регулярно брить ноги.
Но мы-то знаем, что Пэрри лукавит и продолжает активно работать. Совсем недавно ZAYCEV NEWS писали о её новой песне «Electric» выпущенной совместно с проектом Pokemon 25.
© ООО «ЗАЙЦЕВ.НЕТ», 2004-2021
Средство массовой коммуникации «ZAYCEV.NET».
Выходные данные
125315, г. Москва, ул. Лизы Чайкиной 6
+7 (985) 211-85-11 По общим вопросам:
admin@zaycev.net По вопросам взаимодействия с Правообладателями
e-mail: legal@zaycev.net подписаться на нас:
Источник