Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Building GenAI Powered Android Apps (By: Muhamm...

Building GenAI Powered Android Apps (By: Muhammad Hashir Rafique) - Google I/O Extended 2024

Talk by Muhammad Hashir Rafique (https://www.linkedin.com/in/hashirrafique/) at Google I/O Extended 2024 by GDG Lahore.

GDG Lahore

August 10, 2024
Tweet

More Decks by GDG Lahore

Other Decks in Programming

Transcript

  1. Building GenAI Powered Android apps Leveraging Gemini in API in

    your Android apps Demo By Hashir Rafique LinkedIn: https://www.linkedin.com/in/hashirRafique/
  2. About Myself •Senior Software Engineer at ExperLabs •Working from the

    past 5+ years in mobile app industry. •Expertise in both iOS and Android applications.
  3. AI vs GenAI • Conventional AI trained for specific inputs

    and outputs • Trained to perform logical as well as deduction based executions. • Conventional AI prediction based e.g. Predicting weather. • GenAI trained on modals with a wide variety of datasets. • Comes in handy to create content from a creative point of view. • GenAI used to create new content sometimes indistinguishable from human created content.
  4. Google Gemini • Google’s very own GenAI Model created with

    support multi-modal content generation i.e. images, texts, audio, videos etc. • Focused on generating content which resembles more to human created content to provide fluid interactions between human and AI. • Integration with google services to enhance user experience across google’s ecosystem, making life easier for their users. • Different Gemini API Models available
  5. Gemini Use Cases • Instant Replies. • Rewrite given Texts

    from prompts. • Compose new Content from given points. • Summarise content. • Create a story or describe details from a given image. • Prompting Gemini to generate responses.
  6. Integrating gemini to our app • 4 Simple Steps Create

    API Key from Google AI SDK Studio Include Google AI SDK dependencies in our code Integrate Gemini Pro to Kotlin Code Pass the prompt text to get the desired results.
  7. Get GoogleAI SDK Client ID • Head over to https://aistudio.google.com/app/apikey

    • Generate a client ID against a new project or an existing one:
  8. Integrate Gemini API to Kotlin We can also use the

    stream method to generate response in chunks
  9. Gemini API Template in Android Studio • Generative AI Template

    in Android studio for beginners • Requires you to have your API Key • Adds all dependencies by itself • Generates the code for calling the modal API • Gives an initial code to practice prompting response from Gemini
  10. Gemini API Template in Android Studio • Create a new

    Project • Select Gemini API Starter • Recommended to use newer target SDK version for better compatibility
  11. Reachout to me on LinkedIn: https://www.linkedin.com/in/hashirRafique Thank You! “Don't just

    strive to make things better; strive to make things that matter. The future belongs to those who push boundaries and turn the impossible into reality.”