Products developed
Years on the market
Five-star reviews
Startup exits
In-house experts
120+ excellent products shipped
Venture Building & Product Development Timeline
Let’s talk expert to expert.
Dive into the latest industry wisdom from our experts.
Crash-Proofing Your Code: Setting Up Sentry on Android
Welcome back! As promised, we are here with the second part of the Crash-proofing series. This time, we will show you how to set up Sentry for the Android platform and some nice-to-have stuff as a bonus.
Let's begin!
Create sentry.properties file inside your Android project’s root folder
Initial setup in Sentry Admin
These are a few things you need to do before implementing Sentry Android SDK.
- Create a new project in Sentry. Give this project some appropriate name like your-project-android
- Then go to Settings → Projects → Your new Project → General Settings
- You should see the name of your project. This is your project_id. In sentry.properties, replace <project_id> with it
- Then go to Organization settings → General Settings, copy your organisation_slug and replace <organisation_slug> inside sentry.properties
- Then go to User and tokens and create new Token. You can add every permission to it for a start but its better to check every permission and decide for yourself what is needed.
- Then copy your new auth token and replace <auth_token> with it inside sentry.properties.Sentry can upload ProGuard mapping files for you and needs this auth token. Ignore this if you don’t care about ProGuard
- Your sentry.properties should be filled now.
- Then go to Settings → Projects → Your new Project → Client Key (DSN)
- Get your DSN link and save it somewhere for now.
- Now you can return to your Android Project
Adding sentry to project
A full tutorial is on this page. Sentry can set itself with a command, but if you prefer a manual approach or have problems, follow the instructions below or this page. Sentry will also give you a direct link for setup in Android Studio (https://sentry.io/organizations/XXX/projects/YYY/getting-started/)
- Add this to your main module build.gradle
- Open your application class and initiate Sentry
Let’s explore what each line does:
This line applies the environment to the issue. If you use several build flavors like development and production, you can then easily filter specific flavors.
These lines set the percentage value of how many traces to log. 100% means everything is logged. It’s not recommended to collect everything in a production environment; however, e.g., on development, it’s a good thing since testers could find bugs. In our example, we set the percentage on the release version to 10%.
- Open your AndroidManifest.xml file inside your main module and insert this
If you don’t want to use CI/CD and just hardcode your DSN, replace ${sentryDsnUrl} with your collected DSN link.
- Open app’s build.gradle and setup DSN there as well
- Add Sentry gradle plugin to project
This code enables sentry gradle plugin. This prepares scripts for your convenience like uploading aab to sentry with proguard mapping files.
Nice things to know
Assign someone to new issue
Every issue in Sentry can be assigned to someone and you can do that manually or automatically with rules.
Create Jira issue directly from Sentry
If you setup the Jira integration mentioned in the previous article, Sentry enables you to quickly and easily create Jira issues from the issue itself.
Discover page
Discover page let’s you quickly query in all yours collected data so you can answer analytics questions or analyse potential health issues in your project. You can use predefined queries or create, edit and delete your own queries. It’s really powerful tool but it’s limited only to Trial and Business Plan.
Pluggins for Sentry
Sentry for Android offers plugins which let’s you automatically collect more specific data. For example:
Some stuff like Android Fragments, okHttp events and logcat are already logged automatically from Sentry version 3.1.0.
In order to disable them, change the sentry config in the project’s build.gradle.
OkHttp plugin
Like said above, from Sentry 3.1.0, Sentry will automatically log OkHttp event via manipulating your final bytecode and inserting SentryOkHttpInterceptor. This will create breadcrumbs which would look like this:
If you use Sentry 3.11.0+, Sentry will also insert SentryOkHttpEventListener which will log even more data from http requests. Everything will be logged with logcat:
Thank you for diving into the second part of our series. If you have any questions, feel free to catch up or reach out.
From Code to Culture: The Backbone of Our Backend Team
Hey there! Curious about what makes our backend team tick? Let me spill the beans on what keeps us running at Cleevio.
Team Contract: Our Secret Sauce
Ever heard of a team contract? It's like our BE team's rulebook but cooler. We all chipped in to create this gem, covering everything from our core values to nifty Slack etiquettes (like no-reply expectations after 4 PM). It's not just a newbie guide; even our weathered developers learn a thing or two from it.
Bringing the Team Together
With team members scattered across Prague, Brno, and beyond borders, building bonds ain't easy, but we're not ones to back down from a challenge. That's why we came up with Backend Onsite Day. Originally a monthly affair, we scaled it back to every two months to make it work for everyone. It's a chance to catch up, brainstorm, and maybe even grab a beer together.
Sharing Know-How Like a Boss
We take knowledge sharing seriously. Our weekly BE meetings aren't just about updates and project briefs - they are also our chance to pick each other's brains. Plus, we've got knowledge base packed with tech insights and project learnings. It's like having a cheat sheet for all things backend.
Reflect, Refine, Repeat
We're all about improvement. That's why we love our team retrospectives. Just recently, at the start of 2024, we huddled up for about an hour to chat about how things were going. Turns out, everyone is pretty happy being part of the team, which is great to hear - but we also came up with some ideas to make things even better next time. It's all about celebrating wins and figuring out how we can crush it even more in the future.
Growing Together
Personal growth is big on our agenda. Regular performance reviews and one-on-one chats keep us on track. And with internal training programs, education budgets, and buddy systems in place, we're all set to level up together.
At the end of the day, it all comes down to communication. Whether it's a quick Slack chat or a face-to-face meeting, keeping the lines of communication open is what keeps our team humming.
So there you have it—our backend team's recipe for success. With a healthy dose of teamwork, communication, and a sprinkle of resilience, there's no limit to what we can achieve together at Cleevio.
Crash-Proofing Your Code: A Guide to Firebase, Bugfender, and Sentry
When you own a significant product, releasing it to the public requires more than just hope for the best. Even with developers and testers checking the product, some mistakes usually make their way into production. To identify any user-discovered issues, a monitoring system becomes crucial. These systems play a vital role in maintaining the quality and stability of software applications. While you can implement your solution, there are already numerous tools on the market designed for this purpose, so why reinvent the wheel?
Let's explore some monitoring systems:
Firebase
Managed by Google, this set of tools provides Crashlytics for both fatal and non-fatal crashes in your product, along with analytics and additional features. The tool is available for free; all you need is a Google email account and to configure some settings.
BugFender
This lesser-known tool handles crash logging and data collection and can also collect user feedback. In the free subscription tier, they offer a limited set of features and 24-hour log retention. For more serious projects, a paid subscription is required.
Sentry
Sentry is a monitoring tool offering a vast array of features. It supports various platforms, including mobile, web, and gaming frameworks, with community support for many more. Sentry tracks event logs and crashes and assists in analyzing them. It also provides insight into the performance of your product, supporting widely used programming languages. Sentry has different subscription tiers; the free tier provides basic features, which may be sufficient for solo developers. The higher the subscription, the more support and metrics your product receives. Check out the detailed features that we particulary like:
Error Tracking and Monitoring
Easy to add to your project, Sentry automatically collects data like device info, web browser info, crash logs, and additional user interactions. The specifics of what is tracked depend on the platform and activated Sentry plugins. For instance, in the Android system, Sentry can track user interactions, HTTP calls, visited screens, and more. This information makes it easier to identify the cause of errors.
Real-Time Alerts
Sentry allows you to set alerts based on various conditions. For example, if a completely new error occurs, Sentry can send you an email or trigger a webhook to receive a message in platforms like Slack or Microsoft Teams, enabling a quick response to the issue.
Error Insights
Opening an issue in Sentry reveals device info, product version, details of where and what went wrong, and the actions taken by the app and user before the issue (breadcrumbs). Sentry can also provide statistics about the issue, grouped into categories, making it easier to discover patterns, such as the issue occurring only on Safari browsers or on iOS 16.
Supported Languages and Platforms
Sentry supports numerous programming languages and platforms, making it versatile for use in various products, whether in mobile development using Kotlin or Swift, or web development using React, Angular, ASP.NET, PHP, and more.
Performance Metrics
With Sentry log collection, you can analyze the performance of specific parts of your product. This includes understanding the performance of web pages, identifying features that consume more time, or pinpointing dropped frames or lags in mobile apps.
Ease of Integration
Integrating Sentry's SDK into your product is straightforward, regardless of the platform. Sentry provides tutorials, requiring you to create an account, a new project, and add the provided ID and DNS link to your product. You can then test crashes to ensure they appear in Sentry. Additionally, many existing tools support integration with Sentry, including messaging programs like Slack or Microsoft Teams, project management tools like Jira, and git repositories like GitHub and Bitbucket.
Self-hosting Sentry and Pricing
Sentry can be hosted on your server, offering more independence for companies. However, a license fee still applies.
Pros and Cons of Sentry:
Pros:
- Specialized for error tracking and analysis
- Supports a wide range of platforms
- Offers real-time alerts
- Provides detailed error insights
- Supports community and open-source contribution
- Many third-party integrations
Cons:
- Not free; the price depends on the features you need
- The abundance of features in Sentry can be overwhelming
This article is the first part of a two-part series. The next article will guide you on setting up Sentry for the Android platform.
Thank you for reading!