Back to Blog VERSION 1

PancreasAI v1 — What It Can Do Now

It started as a simple glucose dashboard — connect your Dexcom, see a chart, done. Over the past several weeks of iterating, PancreasAI has grown into something I'm genuinely proud of. Version 1 is a pretty complete diabetes management companion for Android, and this post is a summary of everything it can do.

Connecting to Dexcom

The app supports two ways to pull your CGM data:

Dexcom Share (username + password)

This is the easiest option. You just enter your Dexcom credentials and the app pulls readings every few minutes via the Share API. This works for both legacy username-based accounts and modern email-based accounts (G7/Clarity signups), which required some tricky multi-step login logic to get right — it automatically tries four different login combinations until one works.

Developer API (OAuth)

This is the more "official" route if you have a Dexcom developer account. It uses a proper OAuth flow with a browser-based login, access tokens, and automatic refresh when they expire. There's also a sandbox mode for testing with dummy data.

Both modes support US and outside-US regions.

The Main Dashboard

The home screen shows your current glucose reading, trend arrow, and a scrollable chart of recent readings. Color coding follows standard CGM conventions — red for low, green for in-range, orange/yellow for high.

You can adjust the chart window from 2 hours all the way out to 24 hours using a time range selector. The chart overlays your insulin doses and meals as markers directly on the glucose line, so you can visually see how food and insulin moved your numbers.

Auto-refresh runs in the background and can be configured from 1 to 30 minutes.

Insulin Tracking

Log rapid-acting, long-acting, or "other" insulin doses with units, timestamp, and an optional note. Everything is stored locally on your device. The log shows your recent doses in a scrollable list with swipe-to-delete, and doses appear as markers on the glucose chart.

Food Tracking

Log meals with carb count, calorie count, and a meal type (breakfast, lunch, dinner, snack, drink, or other). Like insulin, meals are stored locally and appear as markers on the chart. This was added specifically to support the Insights feature — without meal data, it's hard to analyze how food affects your glucose.

HTML Report Export

Tap the export button and choose a time window — last 24 hours, 3 days, 7 days, 14 days, 30 days, or 90 days — and the app generates a self-contained HTML report you can save, print, or share with your care team. The report includes your glucose statistics, time-in-range breakdown, a summary of insulin doses, and meals logged during the period.

Insights (the new big feature)

This is the most substantial addition in v1. Tap the lightbulb icon in the toolbar to open the Insights screen, which analyzes all your stored data and surfaces patterns you might not notice day-to-day.

Time of Day Patterns

Your day is divided into six 4-hour slots. Each slot shows your average glucose, time-in-range percentage, and how often you're running low or high. This makes it easy to spot whether mornings are consistently worse than afternoons, for example.

Post-Meal Response Curves

For every logged meal, the app tracks your glucose baseline just before eating, then records how much it rose at 60, 120, and 180 minutes. It plots the average curve alongside faint lines for each individual meal, so you can see both your typical response and the variance. A table of recent meals shows the details.

Post-Insulin Response Curves

Same idea for insulin doses. It tracks your glucose at the time of each dose, then measures the drop at 60, 120, and 180 minutes. Useful for understanding how quickly your insulin works and how much it drops you.

ISF Estimation (Insulin Sensitivity Factor)

If you have at least three rapid insulin doses logged, the app estimates how many mg/dL one unit of insulin drops your glucose on average. It trims outliers to get a more reliable number.

ICR Estimation (Insulin-to-Carb Ratio)

With five or more meals and a working ISF estimate, it calculates roughly how many grams of carbs one unit covers.

Pattern Detection

The app automatically flags common issues: dawn phenomenon (glucose rising in the early morning hours), nocturnal lows, meals that consistently cause large spikes, peaks that come unusually late, and time slots with poor time-in-range.

AI Suggestions (optional)

If you add your own Anthropic API key in Settings, the Insights screen will send an anonymized summary of your data to Claude and get back a personalized write-up covering your overall control, potential ISF/ICR adjustments, insulin timing suggestions, and strategies to flatten post-meal spikes. No personal information is sent — just numbers and timestamps. This section is completely optional; everything else works without it.

Settings & Diagnostics

The Settings screen has gotten a lot more capable over time:

Technical Notes

The app is built natively in Kotlin for Android (API 26+). It uses:

All data (glucose log, insulin, meals) is stored locally in SharedPreferences and JSON files. Credentials are stored in Android's encrypted SharedPreferences.

The source code is distributed as a zip with a setup.bat script that copies everything into the correct project structure for Android Studio.

What's Next

The main thing I want to tackle is getting the Share login working for accounts with special characters in the password — that's a JSON escaping issue that's actively being debugged. Beyond that, the natural next step would be background notifications for out-of-range readings, and possibly exporting data to CSV for use in other tools.

Try It Out

PancreasAI v1 represents weeks of iteration and refinement, and I'm excited to share it with the community. The combination of real-time glucose monitoring, insulin and food tracking, and AI-powered insights creates a comprehensive tool for understanding and managing diabetes.

If you're interested in trying the app or contributing to development, check out our GitHub repository for the latest source code and setup instructions.

⚠️ Important Disclaimer: PancreasAI is a personal project and is not a medical device. AI suggestions are for informational purposes only. Always work with your healthcare team on insulin dosing decisions.