<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Ibrahim</title>
    <description>The latest articles on Forem by Ibrahim (@ibrahim_broach).</description>
    <link>https://forem.com/ibrahim_broach</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F321564%2F4c13ebb4-5428-4ccf-8d2e-a43973dc2263.png</url>
      <title>Forem: Ibrahim</title>
      <link>https://forem.com/ibrahim_broach</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/ibrahim_broach"/>
    <language>en</language>
    <item>
      <title>How to Build a Mobile App Using Free AI Tools: My Journey with Splitup</title>
      <dc:creator>Ibrahim</dc:creator>
      <pubDate>Fri, 23 May 2025 07:06:58 +0000</pubDate>
      <link>https://forem.com/ibrahim_broach/how-to-build-a-mobile-app-using-free-ai-tools-my-journey-with-splitup-gk5</link>
      <guid>https://forem.com/ibrahim_broach/how-to-build-a-mobile-app-using-free-ai-tools-my-journey-with-splitup-gk5</guid>
      <description>&lt;p&gt;I recently created Splitup, a simple expense-splitting app, using only free AI tools. Here's a step-by-step guide on how I did it and what I learned about leveraging AI to streamline app development.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I Wanted to Build
&lt;/h2&gt;

&lt;p&gt;I'd tried several expense-splitting apps, but most felt cluttered or overly complex. My goal was to create something focused on 3 things:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Split expenses seamlessly&lt;/li&gt;
&lt;li&gt;Send reminders to friends&lt;/li&gt;
&lt;li&gt;Simplify settling up&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;With a clear vision, I turned to free AI tools to bring Splitup to life. Here's how you can do the same.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 1: Set Up Your App's Foundation
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Tool&lt;/strong&gt;: Cursor + GitHub Copilot (free tiers)&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How I Used It&lt;/strong&gt;: These tools were perfect for generating the app's structure, routing, and boilerplate code. I used Cursor's AI to scaffold my Flutter project and Copilot to suggest code snippets for navigation and basic setup.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Tip&lt;/strong&gt;: Use Cursor rules for optimal results. Start with small, specific prompts like&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Generate a Login Screen with google and apple login buttons.&lt;/li&gt;
&lt;li&gt;Create a Controller using Riverpod 2.0. &lt;/li&gt;
&lt;li&gt;Keep the business logic in Controller separate from the UI. &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Break down your app's core components and let AI handle the repetitive setup work.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 2: Build a Robust Backend
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Tool&lt;/strong&gt;: Supabase AI&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How I Used It&lt;/strong&gt;: Supabase was a revelation for me as a first-time user. Its AI features helped me design database schemas, set up Row-Level Security (RLS) policies, define constraints, and create webhooks for real-time functionality.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Tip&lt;/strong&gt;: Use Supabase's AI to draft your database schema by describing your data model in plain language (e.g., "a table for expense transactions with foreign key constraints to group table (group_id)"). Test and refine the generated SQL to fit your needs.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 3: Design a User-Friendly Interface
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Tool&lt;/strong&gt;: ChatGPT&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How I Used It&lt;/strong&gt;: I leaned on ChatGPT for UI inspiration, app icon ideas, and writing app store descriptions. For example, I prompted it with "suggest a clean, modern UI for a budgeting app" and got actionable design ideas.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Tip&lt;/strong&gt;: Be specific with your prompts:ask for color schemes, layout ideas, or even specific UI components. Use the suggestions as a starting point and tweak them to match your vision. Now I would use &lt;a href="https://stitch.withgoogle.com" rel="noopener noreferrer"&gt;https://stitch.withgoogle.com&lt;/a&gt;, which would do a much better job at UI design.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 4: Debugging, Optimizations and Core app Features
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Tool&lt;/strong&gt;: Grok&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How I Used It&lt;/strong&gt;: Grok was my go-to for debugging tricky issues, writing Supabase edge functions, and exploring monetization strategies. It helped me fix bugs by analyzing error logs and suggesting precise solutions. Apps's core logic of settling balances was written by Grok.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Tip&lt;/strong&gt;: When stuck, share your code or error messages with Grok and ask for step-by-step fixes. For advanced features like edge functions, describe the logic you need with as much detail as possible, and refine the generated code through iteration.&lt;/p&gt;

&lt;h2&gt;
  
  
  Key Takeaways for Building with AI
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Break It Down&lt;/strong&gt;: You can't build an entire app with one prompt. Split features into smaller tasks (e.g., "create a login screen" or "write a function to split expenses") and iterate multiple times.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Clarify Your Vision&lt;/strong&gt;: A clear product idea keeps your prompts focused and ensures AI tools deliver relevant outputs.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Embrace Iteration&lt;/strong&gt;: AI-generated code or designs often need tweaking. Test early, refine often, and don't expect perfection on the first try.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;AI Is Essential&lt;/strong&gt;: After this experience, I can't imagine coding without AI - it saves time and sparks creativity.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Result
&lt;/h2&gt;

&lt;p&gt;Splitup is now live on both appstore and playstore, and I'm thrilled with how it turned out. You can check it out here: &lt;a href="https://onelink.to/etcezf" rel="noopener noreferrer"&gt;https://onelink.to/etcezf&lt;/a&gt;.&lt;br&gt;
Building it was a testament to how powerful free AI tools can be for indie developers.&lt;/p&gt;

&lt;h3&gt;
  
  
  Try It Yourself
&lt;/h3&gt;

&lt;p&gt;Start with a simple app idea, pick one or two AI tools, and experiment. What's your favorite AI tool for development, or what are you building next? Share your tips below!&lt;/p&gt;

&lt;p&gt;#AppDevelopment #FlutterDev #Supabase #IndieDev #MobileApps #AItools #Tutorial&lt;/p&gt;

</description>
      <category>flutter</category>
      <category>supabase</category>
      <category>ai</category>
      <category>cursor</category>
    </item>
    <item>
      <title>Dynamic Geofencing 100+ in Kotlin - Android</title>
      <dc:creator>Ibrahim</dc:creator>
      <pubDate>Sat, 15 Feb 2020 19:29:43 +0000</pubDate>
      <link>https://forem.com/ibrahim_broach/dynamic-geofencing-100-in-kotlin-android-jg0</link>
      <guid>https://forem.com/ibrahim_broach/dynamic-geofencing-100-in-kotlin-android-jg0</guid>
      <description>&lt;p&gt;Geofencing API by Google helps provide contextual information to users based on their location. However, we have a limit of 100 active geofences at one time. &lt;/p&gt;

&lt;p&gt;Lets break the limit with dynamic geofencing to suit our usecase. &lt;/p&gt;

&lt;h1&gt;
  
  
  What's our use case?
&lt;/h1&gt;

&lt;p&gt;We need to ping our users when they are near any Toll Plaza with an "Upcoming Toll Plaza" notification on their device. How many Tolls do we have in India? &lt;a href="http://tis.nhai.gov.in/" rel="noopener noreferrer"&gt;500+&lt;/a&gt;. Before we get into registering 500+ geofences dynamically. Lets see what do we already know.&lt;/p&gt;

&lt;h2&gt;
  
  
  Geo.. What?
&lt;/h2&gt;

&lt;p&gt;Geofence is a geographical region which can be monitored for transition events such as Entry, Exit or Dwell. Have a look at this diagram.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fe1tni5u3eqdcpngmjsgh.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fe1tni5u3eqdcpngmjsgh.png" alt="Alt Text" width="512" height="512"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We are interested only in &lt;strong&gt;Entry&lt;/strong&gt; and &lt;strong&gt;Exit&lt;/strong&gt; transition events for now. &lt;/p&gt;

&lt;p&gt;We know we have a limit of 100 geofences at a time. &lt;/p&gt;

&lt;p&gt;Straight Outta Docs:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;You can have multiple active geofences, with a limit of 100 per app, per device user. For each geofence, you can ask Location Services to send you entrance and exit events, or you can specify a duration within the geofence area to wait, or dwell, before triggering an event. You can limit the duration of any geofence by specifying an expiration duration in milliseconds. After the geofence expires, Location Services automatically removes it.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Geo.. How?
&lt;/h2&gt;

&lt;p&gt;Let's Engineer. We have a limit of 100 active geofence. So we need to figure out a radius for a region which can never have more than 100 geofences inside it. According to our use case, we can safely assume &lt;strong&gt;300km&lt;/strong&gt; radius. We will call this region &lt;em&gt;Parent Region&lt;/em&gt;. Inside this &lt;em&gt;Parent Region&lt;/em&gt; we will have multiple &lt;em&gt;Child Regions&lt;/em&gt; - &lt;strong&gt;5km radius&lt;/strong&gt; which are our actual geofences for Tolls. When the device exits the &lt;em&gt;Parent Region&lt;/em&gt; we will setup a new &lt;em&gt;Parent Region&lt;/em&gt; from the device's current location and reset the toll geofences. Using this, at no point device will have 100+ active geofences. As device moves out of the 300km region, new geofences will get registered dynamically.&lt;/p&gt;

&lt;p&gt;We now have following tasks to perform: &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;em&gt;Parent Region&lt;/em&gt; : Setup a Geofence of 300km radius from user's current location with Geofence transition event set to &lt;strong&gt;EXIT&lt;/strong&gt;. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Filter out locations (Tolls) from the list of 500+ locations which fall inside the above region by calculating their distance.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;em&gt;Child Region&lt;/em&gt; : Setup a Geofence of 5km radius on all filtered locations with Geofence transition event set to &lt;strong&gt;ENTRY&lt;/strong&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;When transition event &lt;strong&gt;ENTRY&lt;/strong&gt; is triggered on &lt;em&gt;Child Region&lt;/em&gt;, display a notification to user.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;When transition event &lt;strong&gt;EXIT&lt;/strong&gt; is triggered on &lt;em&gt;Parent Region&lt;/em&gt;, unregister all the existing &lt;em&gt;Child Regions&lt;/em&gt;  and &lt;strong&gt;repeat steps 1 to 3.&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;em&gt;Note: &lt;strong&gt;300km&lt;/strong&gt; for Parent Region and &lt;strong&gt;5km&lt;/strong&gt; for Child Region are assumptions I have made for my use case. Feel free to set the radii as per your requirement.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Geo..Code!
&lt;/h2&gt;

&lt;p&gt;Before we get into dynamic geofences. How do we register a single geofence? Check out this &lt;a href="https://www.raywenderlich.com/7372-geofencing-api-tutorial-for-android" rel="noopener noreferrer"&gt;great article&lt;/a&gt; on raywenderlich.com on how to setup geofence in Android which I have followed in this article as well. &lt;/p&gt;

&lt;p&gt;Lets start by creating models.&lt;/p&gt;

&lt;p&gt;Geofence&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;id&lt;/li&gt;
&lt;li&gt;latitude&lt;/li&gt;
&lt;li&gt;longitude&lt;/li&gt;
&lt;li&gt;radius&lt;/li&gt;
&lt;/ul&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;Toll&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;id&lt;/li&gt;
&lt;li&gt;name&lt;/li&gt;
&lt;li&gt;latitude&lt;/li&gt;
&lt;li&gt;longitude&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;We will be fetching our tolls from &lt;em&gt;Room&lt;/em&gt; database. Here's an Entity class for &lt;em&gt;Toll&lt;/em&gt; table.&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;1) The first step is to setup a parent geofence with a region of 300km radius.&lt;/p&gt;

&lt;p&gt;Put this code in your Launcher/Main Activity.&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;What's happening?&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;We get user's current location.&lt;/li&gt;
&lt;li&gt;We create an instance of &lt;code&gt;GeofenceHelper&lt;/code&gt; class.&lt;/li&gt;
&lt;li&gt;We setup parent geofence. &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;GeofenceHelper&lt;/code&gt;:&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;What's happening?&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Inside &lt;code&gt;setupParentGeofence()&lt;/code&gt; function, we create Parent Geofence model with id,lat,long and radius of 300km.&lt;/li&gt;
&lt;li&gt;We build a Geofence with transition EXIT for parent region. We are passing an enum value &lt;code&gt;GeofenceType.PARENT&lt;/code&gt; to &lt;code&gt;buildGeofence()&lt;/code&gt; function for distinction.&lt;/li&gt;
&lt;li&gt;Make sure to ask user for Background Location permission before setting up geofences in MainActivity. We include a location permission check here before registering geofences.&lt;/li&gt;
&lt;li&gt;Use &lt;em&gt;geofencingClient&lt;/em&gt; object to register geofences. It takes a GeofencingRequest and a PendingIntent pointing to GeofenceBroadcastReceiver where we handle our geofencing event triggers. More about this later.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;2) Now we setup our &lt;em&gt;Child Regions&lt;/em&gt; (Toll locations) which fall in the above &lt;em&gt;Parent Region&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;Update &lt;code&gt;setupGeofences()&lt;/code&gt; function in MainActivity as below.&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;What's happening?&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;We are using MVVM design pattern with LiveData. &lt;code&gt;mViewModel.tollsList.observe&lt;/code&gt; will fetch all the tolls from the database which we pass into &lt;code&gt;setupChildGeofences()&lt;/code&gt; function inside our helper class. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Hold up! as we have seen above we need a Geofence model for registering geofences. However, we get a list of Toll models from the database. Let's transform all Toll models into Geofence models using &lt;em&gt;Transformations&lt;/em&gt; provided by androidx.lifecycle.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;ul&gt;
&lt;li&gt;Along with the tolls list, we are also passing user's current lat-long into &lt;code&gt;setupChildGeofences()&lt;/code&gt;. Why? Keep reading!&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Let's look at &lt;code&gt;setupChildGeofences()&lt;/code&gt; function.&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;What's happening?&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;We use &lt;code&gt;Location.distanceBetween()&lt;/code&gt; function to filter the list of locations. We use user's current lat-long and check if the toll's location is less than 300km from user's current location in distance.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;We run a loop on this filtered list and register geofences similar to parent geofence. Double check you are passing &lt;code&gt;GeofenceType.CHILD&lt;/code&gt; to &lt;code&gt;buildGeofence()&lt;/code&gt;function.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;After successful registration, we store ids of these child geofences to SharedPreferences, so that we can unregister them later. &lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Congratulations! We have successfully registered one parent geofence and multiple child geofences inside it.
&lt;/h4&gt;

&lt;h2&gt;
  
  
  Geo..Dynamic!
&lt;/h2&gt;

&lt;p&gt;Let's jump right into code, where our Entry and Exit events are captured.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;GeofenceTransitionsJobIntentService&lt;/code&gt;&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;What's happening?&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;GeofenceTransitionsJobIntentService's &lt;code&gt;enqueueWork()&lt;/code&gt; is called from the &lt;code&gt;onReceive()&lt;/code&gt; of our registered GeofenceBroadcastReceiver below.&lt;/li&gt;
&lt;/ul&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;ul&gt;
&lt;li&gt;&lt;p&gt;In &lt;code&gt;onHandleWork()&lt;/code&gt;, we have a geofencingEvent created from the intent. We pass this event to &lt;code&gt;handleEvent()&lt;/code&gt; function where all the magic happens.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;If the transition event is &lt;code&gt;GEOFENCE_TRANSITION_ENTER&lt;/code&gt;, we have a child geofence entry event, so we generate a notification for the user with the Toll name and a title - "Upcoming Toll Plaza".&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;If the transition event is &lt;code&gt;GEOFENCE_TRANSITION_EXIT&lt;/code&gt;, we have a parent geofence exit event, so we setup a new parent region and child regions same as before. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Before registering new geofences, we unregister existing child geofences by Ids stored in SharedPreferences.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;For device's current location we use, &lt;code&gt;event.triggeringLocation.latitude&lt;/code&gt; and &lt;code&gt;event.triggeringLocation.longitude&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Since we are already in a background thread now, we can directly get the list of Tolls and map each element to Geofence model. &lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Awesome! We have successfully implemented dynamic geofencing in Android.
&lt;/h4&gt;

&lt;p&gt;I am open to feedbacks and suggestions. Please reach out if you have any doubts.&lt;/p&gt;

</description>
      <category>geofence</category>
      <category>android</category>
      <category>location</category>
      <category>kotlin</category>
    </item>
  </channel>
</rss>
