惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

aimingoo的专栏
aimingoo的专栏
腾讯CDC
Y
Y Combinator Blog
L
LangChain Blog
B
Blog
U
Unit 42
P
Proofpoint News Feed
G
Google Developers Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
博客园 - 【当耐特】
WordPress大学
WordPress大学
月光博客
月光博客
Vercel News
Vercel News
雷峰网
雷峰网
T
The Blog of Author Tim Ferriss
MyScale Blog
MyScale Blog
大猫的无限游戏
大猫的无限游戏
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
酷 壳 – CoolShell
酷 壳 – CoolShell
Blog — PlanetScale
Blog — PlanetScale
博客园 - 司徒正美
云风的 BLOG
云风的 BLOG
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
博客园 - 叶小钗

LineageOS

Summertime Updates! Developer Verification Changelog 31 - Masterful Material, Expressive Emotions, Awesome Android Changelog 30 - Sleek Sixteen, Streamlined Suite, Future Flow Changelog 29 - Flourishing Fifteen, Simply Streamlined, Vibrant Vibes Sunsetting LineageOS 18.1 Changelog 28 - Fantastic Fourteen, Amazing Applications, Undeniable User-Experience Changelog 27 - Thriving Thirteen, Amazing Aperture, Careful Commonization Changelog 26 - Tailored Twelve, Audacious Automotive, Neat Networking, Devoted Developers Changelog 25 - Exemplary Eleven, Ravishing Recorder, Captivating Calendar, Beaming Backup Changelog 24 - Tenacious Ten, Rad Recovery, Witty Wiki, and Terrific Themes! Changelog 23 - Brilliant Backgrounds, Versatile Volume and Terrific Tiles Changelog 22 - Pushing Pie, Bracing Builds and Careful Calculator Changelog 21 - Nightlies Now, Improved Infrastructure and Precious Pie Summer Survey 2 results Changelog 20 - Dynamic Dialer, Excellent Email, Capacious Clock Summer Survey 2 - Attack of the feedbacks Changelog 19 - Absolutely AB, Rocking Recovery and Blackened Black Trust me, I'm an engineer Changelog 18 - Ready reader, super suggestions and functional firewall An April Apology Changelog 17 - Building Blockchains, Genuine Guarantee, and Lucky Lock Changelog 16 - Smart Styles, Treble is trouble and Omfg Oreo Celebrating one year of LineageOS Changelog 15 - Super Security, Gratifying Gestures, Resounding Recorder Summer Survey - Results Changelog 14 - Powerful PrivacyGuard, Unique Updater, Brave Burn-in protection and Awesome AudioFX Summer Survey Changelog 13 - Wonderful Webviews, Pedantic Permissions and Disappearing Dates Changelog 12 - Jam-packed Jelly, Terrific Tiles, and Updated Updater
Introducing the LineageSDK
LineageOS · 2018-03-20 · via LineageOS

hero sdk-structure

Introducing the LineageSDK for developers

LineageOS is an operating system for everyone: from the average user to the advanced developer. While users have a giant playground in their hands with many customization options, we also want to make LineageOS a fun place for developers. The standards for official builds help ensure developers that their app will not end up in a bad state because of inappropriate Android API changes or broken hardware support, but this is not enough for us; we’re announcing some new APIs that will allow your apps to do more when they’re running on a LineageOS-powered device.

The Lineage platform SDK (LineageSDK for short) is a powerful resource that allows us to both keep our features out of the core Android frameworks (for better security and easier bringup processes) and expose some extra functionality to app developers.

The first official release, Ilama (API 9), is the first public iteration that’s available to your apps with a set of useful APIs. We have created a section on our wiki with all the documentation you may desire, including example snippets and the javadoc.

Here are our favorite APIs of this release:

Styles API

We’ve recently introduced system styles on LineageOS 15.1 to allow users to customize the appearance of the device with a dark mode and custom accent color.

With the Styles API, you can give your app an optional automatic dark theme by just using the official AppCompat-v7 library. You don’t have to include a new external library or make huge code changes to offer your users a UI that is in sync with the system. On devices that aren’t running LineageOS, you can expose a toggle for it or control the style at runtime. That’s it: a painless global light/dark mode for everyone.

What if you want your app to theme the system instead? A music player could tune the accent colors of the system based on the album art, or your weather app could set a dark mode when the weather is bad and light when the sun is shining bright: the sky is your only limit.

Head over to the API wiki page for more detailed informations including code snippets.

Profiles API

System profiles are one of the most powerful LineageOS features, they allow to change several device’s preferences with a single click. Profiles can be enabled manually or with a predefined trigger (using WiFi, Bluetooth and/or NFC). A profile contains a set of instructions to control the device’s hardware and software, including (but not limited to) networks, volumes and display adjustments.

Let’s say you are developing a controller app for the next big IOT product and you want your device to adapt when something happens. With the Profiles API you can extend the trigger capabilities (by enabling a profile that could be both user-created or predefined) when interaction with the IOT device is going on using your official APIs.

The profiles API empowers apps to control the handheld device in new ways without having to worry about security issues or using unofficial undocumented APIs that may break/change from a release to another.

Head over to the API wiki page for more detailed informations including code snippets.


These are just a couple of the various APIs you will find inside the LineageSDK and you can check out the full documentation to see all of them.

To sum up

The LineageSDK API 9 is now rolling out with this week’s LineageOS 15.1 builds, and new versions will be announced in future regularly irregular blog posts as new APIs are added and stabilized.

The SDK is completely open source and contributions (including new APIs) are welcome on our gerrit, so you can make this platform grow and evolve in a useful direction for both your app and the whole ecosystem.

To get started, head over to this wiki page.

If you have any questions, you can reach us on our subreddit or join the #lineageos-dev Libera.Chat IRC channel.