{"id":207619,"date":"2024-02-23T22:40:31","date_gmt":"2024-02-23T22:40:31","guid":{"rendered":"https:\/\/michigandigitalnews.com\/index.php\/2024\/02\/23\/leverage-gemini-in-your-android-apps\/"},"modified":"2025-06-25T17:21:40","modified_gmt":"2025-06-25T17:21:40","slug":"leverage-gemini-in-your-android-apps","status":"publish","type":"post","link":"https:\/\/michigandigitalnews.com\/index.php\/2024\/02\/23\/leverage-gemini-in-your-android-apps\/","title":{"rendered":"Leverage Gemini in your Android apps"},"content":{"rendered":"<p> [ad_1]<br \/>\n<\/p>\n<div>\n<meta content=\"https:\/\/blogger.googleusercontent.com\/img\/b\/R29vZ2xl\/AVvXsEjWT4aMu5vc9bH7bcswv8GlJ5Df1hsGQlTgCIPHsU35fjjFHxS8Zj_yQBc9FZhfP4dtNO9uBAMSWoVm4n-VYpJjs-L1-rkOiAClpUJnUDxuh-6KGINCM07Z5AthyphenhyphenXRrQpEtoTFaBjEFs0c0R8QOfu1kKiJgHUkGCKr336joSXqZhMecvGejI9G-9Dgf7ZI\/s1600\/Social-Gemini-Android.png\" name=\"twitter:image\"\/><br \/>\n<img decoding=\"async\" src=\"https:\/\/blogger.googleusercontent.com\/img\/b\/R29vZ2xl\/AVvXsEjWT4aMu5vc9bH7bcswv8GlJ5Df1hsGQlTgCIPHsU35fjjFHxS8Zj_yQBc9FZhfP4dtNO9uBAMSWoVm4n-VYpJjs-L1-rkOiAClpUJnUDxuh-6KGINCM07Z5AthyphenhyphenXRrQpEtoTFaBjEFs0c0R8QOfu1kKiJgHUkGCKr336joSXqZhMecvGejI9G-9Dgf7ZI\/s1600\/Social-Gemini-Android.png\" style=\"display: none;\"\/><\/p>\n<p><em>Posted by Dave Burke, VP of Engineering<\/em><\/p>\n<p><a href=\"https:\/\/blogger.googleusercontent.com\/img\/b\/R29vZ2xl\/AVvXsEgpMUkef4JqgRnGpbAD9Rmf-mN2fG3kBcfymsPyj7bNZV3U-a5cIzsstZoIyKxcL1rbOmHg_TRsrzlzXdtgVegN8795ovwjF_Q_qFkt7WGg0dmVI4ggRx3b5V0ToHpFbR1EgJ0qiAHd27OacIN3FVfo18ksfcZjggzQZm4T86AGC9vFHjX60rSNFkGI2KA\/s1600\/Droid%20and%20phone%20Gemini%20-%20blog%20hero@2x.png\"><img decoding=\"async\" border=\"0\" data-original-height=\"800\" data-original-width=\"1058\" src=\"https:\/\/blogger.googleusercontent.com\/img\/b\/R29vZ2xl\/AVvXsEgpMUkef4JqgRnGpbAD9Rmf-mN2fG3kBcfymsPyj7bNZV3U-a5cIzsstZoIyKxcL1rbOmHg_TRsrzlzXdtgVegN8795ovwjF_Q_qFkt7WGg0dmVI4ggRx3b5V0ToHpFbR1EgJ0qiAHd27OacIN3FVfo18ksfcZjggzQZm4T86AGC9vFHjX60rSNFkGI2KA\/s1600\/Droid%20and%20phone%20Gemini%20-%20blog%20hero@2x.png\"\/><\/a><\/p>\n<p>Last week we unveiled our most capable foundation model, <a href=\"https:\/\/blog.google\/technology\/ai\/google-gemini-ai\/\" target=\"_blank\" rel=\"noopener\">Gemini<\/a>. Gemini is multimodal \u2013 it can accept both text and image inputs. We introduced a way for Android developers to leverage our smallest model <a href=\"https:\/\/goo.gle\/ai-android-blog\" target=\"_blank\" rel=\"noopener\">Gemini Nano<\/a>, on-device. This is available on select devices through <a href=\"http:\/\/d.android.com\/ml\/aicore\" target=\"_blank\" rel=\"noopener\">AICore<\/a>, a system service that handles model management, runtimes, safety features and more, simplifying the work for developers. And today, we&#8217;re introducing new ways for Android developers to access the <b>Gemini Pro<\/b> model \u2013 which runs off-device, in Google&#8217;s data centers.<\/p>\n<h3>App development with Gemini Pro<\/h3>\n<p>Gemini Pro is accessible via the <a href=\"https:\/\/ai.google.dev\/?utm_source=android&amp;utm_medium=referral&amp;utm_campaign=blog&amp;utm_content=\" target=\"_blank\" rel=\"noopener\">Gemini API<\/a>, and it\u2019s our best model for scaling across a wide range of text and image reasoning tasks.  To simplify integrating Gemini Pro, you can use the <a href=\"http:\/\/ai.google.dev\/tutorials\/android_quickstart\/?utm_source=android&amp;utm_medium=referral&amp;utm_campaign=blog&amp;utm_content=\" target=\"_blank\" rel=\"noopener\">Google AI SDK<\/a>, a client SDK for Android. This SDK enables direct integration from Android apps and removes the need for developers to build and manage their own backend infrastructure, reducing development costs and improving velocity.<\/p>\n<p><a href=\"https:\/\/makersuite.google.com\/app\/prompts\/new_freeform\/?utm_source=android&amp;utm_medium=referral&amp;utm_campaign=blog&amp;utm_content=\" target=\"_blank\" rel=\"noopener\">Google AI Studio<\/a> provides a streamlined way for developers to integrate the Gemini Pro model, craft prompts, create API keys, and effortlessly transform ideas into AI apps. Once you have developed your prompt in Google AI Studio, you can simply click on the \u201cGet code\u201d action to generate a Kotlin code snippet, and start integrating Gemini today using the Google AI SDK for Android.<\/p>\n<p><image><\/p>\n<div style=\"text-align: center;\"><img decoding=\"async\" alt=\"Generate Kotlin code for the Gemini API in Google AI Studio\" border=\"0\" id=\"imgCaption\" src=\"https:\/\/blogger.googleusercontent.com\/img\/b\/R29vZ2xl\/AVvXsEjGPWhQo7q9ZYKdn9K2q8SxKEf45upjjZ985sHMk_adY9d5885-yJewNlRbXLJq4gin5q0g0ZFXFIT4yHlyLZDnT_pc1jF0rEo63nEvzZw4XJEQFOFo3bFdDfs43girlgujn7sbXx9SscLsARheFK2ZWYU3kT22HoXI2uNGLN6S8fMObuBfhxUWR6S2woM\/s1600\/image5.png\" style=\"margins: auto; width: auto;\"\/><\/div>\n<p><imgcaption><center><em>Generate Kotlin code for the Gemini API in Google AI Studio<\/em><\/center><\/imgcaption><\/image><\/p>\n<p>We are also making it easier for developers to use the Gemini API directly in the <a href=\"https:\/\/developer.android.com\/studio\/preview\" target=\"_blank\" rel=\"noopener\">latest preview version of Android Studio<\/a>. We\u2019re introducing a <a href=\"https:\/\/developer.android.com\/studio\/preview\/gemini-template\" target=\"_blank\" rel=\"noopener\">new project template<\/a> for developers to get started with the Google AI SDK for Android right away. You\u2019ll benefit from Android Studio\u2019s enhanced code completion and lint checkers, helping with API keys and security.<\/p>\n<p><image><\/p>\n<div style=\"text-align: center;\"><img decoding=\"async\" alt=\"New Project template for AI in Android Studio\" border=\"0\" id=\"imgCaption\" src=\"https:\/\/blogger.googleusercontent.com\/img\/b\/R29vZ2xl\/AVvXsEi6qb8s_gJxz7FdBXiYWO84Y2q0AoTcIVOVRW3jr4AIE44rPAwLItIgguRBebdlUY4bXbc8E2sd4C5zbjY8VVHChVdcqtW-BrSsQuu3wb4VIwZK65ENVR41nnRN6BXlnLkWJneaTF26WTl8tngdK5-LdWzLMi-6KY_4qUJ3VLGzTzIfosbl4L9TPLaYPbw\/s1600\/image3.png\" style=\"margins: auto; width: auto;\"\/><\/div>\n<p><imgcaption><center><em>New Project template for AI in Android Studio<\/em><\/center><\/imgcaption><\/image><\/p>\n<p>To leverage the new template in Android Studio, start a new project through <b>File &gt; New &gt; New Project<\/b> and pick the Gemini API starter template. This template provides a pre-configured project with the necessary code to use the Gemini API. After choosing a project name and location, you will be prompted to <a href=\"https:\/\/makersuite.google.com\/app\/apikey\/?utm_source=android&amp;utm_medium=referral&amp;utm_campaign=blog&amp;utm_content=\" target=\"_blank\" rel=\"noopener\">generate an API key<\/a> in Google AI Studio, and asked to enter it in Android Studio. Android Studio will automatically set up the project for you with the Gemini API connection, simplifying your workflow.<\/p>\n<p>Alternatively, you can import the <a href=\"https:\/\/github.com\/google\/generative-ai-android\/tree\/main\/generativeai-android-sample\" target=\"_blank\" rel=\"noopener\">generative AI code sample<\/a> and set it up in Android Studio through <b>File &gt; New &gt; Import Sample<\/b>, and searching for &#8220;Generative AI Sample&#8221;.<\/p>\n<p><image><\/p>\n<div style=\"text-align: center;\"><img decoding=\"async\" alt=\"Generative AI sample app\" border=\"0\" id=\"imgCaption\" src=\"https:\/\/blogger.googleusercontent.com\/img\/b\/R29vZ2xl\/AVvXsEicoc7spUl6SToRG8IaCisdz8ZgagobEY7o9OW08CKuIGT4Oyo-dJ-2NMAONm2NfZMYUMExBOzt-pNJnM7kXY1Ot03JGseezAnkIWqOGeg0P1HGJMKbYjmFDl2w5PusedwZJcVZeMMASqw6_A74mOcYwaXGq6dfKi2t2mVGm9W2HfvBqjOJMnoZxgSuQpQ\/s1600\/image5.png\" style=\"margins: auto; width: auto;\"\/><\/div>\n<p><imgcaption><center><em>Generative AI sample app<\/em><\/center><\/imgcaption><\/image><\/p>\n<p>Get started building AI-powered features and Android apps using <a href=\"http:\/\/ai.google.dev\/tutorials\/android_quickstart?utm_source=android&amp;utm_medium=referral&amp;utm_campaign=blog&amp;utm_content=\" target=\"_blank\" rel=\"noopener\">Gemini Pro.<\/a><\/p>\n<\/div>\n<p>[ad_2]<br \/>\n<br \/><a href=\"http:\/\/android-developers.googleblog.com\/2023\/12\/leverage-generative-ai-in-your-android-apps.html\">Source link <\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>[ad_1] Posted by Dave Burke, VP of Engineering Last week we unveiled our most capable foundation model, Gemini. Gemini is multimodal \u2013 it can accept<\/p>\n","protected":false},"author":1,"featured_media":207620,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_uf_show_specific_survey":0,"_uf_disable_surveys":false,"footnotes":""},"categories":[146],"tags":[],"_links":{"self":[{"href":"https:\/\/michigandigitalnews.com\/index.php\/wp-json\/wp\/v2\/posts\/207619"}],"collection":[{"href":"https:\/\/michigandigitalnews.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/michigandigitalnews.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/michigandigitalnews.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/michigandigitalnews.com\/index.php\/wp-json\/wp\/v2\/comments?post=207619"}],"version-history":[{"count":1,"href":"https:\/\/michigandigitalnews.com\/index.php\/wp-json\/wp\/v2\/posts\/207619\/revisions"}],"predecessor-version":[{"id":342656,"href":"https:\/\/michigandigitalnews.com\/index.php\/wp-json\/wp\/v2\/posts\/207619\/revisions\/342656"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/michigandigitalnews.com\/index.php\/wp-json\/wp\/v2\/media\/207620"}],"wp:attachment":[{"href":"https:\/\/michigandigitalnews.com\/index.php\/wp-json\/wp\/v2\/media?parent=207619"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/michigandigitalnews.com\/index.php\/wp-json\/wp\/v2\/categories?post=207619"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/michigandigitalnews.com\/index.php\/wp-json\/wp\/v2\/tags?post=207619"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}