Posts

android : @AndroidEntryPoint and @HiltViewModel usage

 @AndroidEntryPoint is an annotation used in Hilt, which is Google’s recommended library for Dependency Injection (DI) built on top of Dagger. What does it actually do? When you mark a class with @AndroidEntryPoint, Hilt generates an individual Hilt component for that specific Android class (in this case, your MainActivity). Member Injection: It allows the class to receive dependencies from Hilt. Without this, you couldn't use the @Inject annotation to get your ViewModels, Repositories, or API services into the Activity. Lifecycle Management: It ensures that the dependencies are tied to the Activity's lifecycle. Hilt will automatically handle creating the component in onCreate() and destroying it when the Activity is destroyed. There are a few things to remember how to use this. We need to use viewModel delegate @dagger.hilt.android.AndroidEntryPoint class MainActivity : ComponentActivity() { private val viewModel : HomeViewModel by viewModels () override fun onCreate (...

android error : (MainActivity}: java.lang.IllegalStateException: Hilt Activity must be attached to an @HiltAndroidApp Application. Did you forget to specify your Application's class name in your manifest's 's android:name attribute?

 Ran into this issue when working with my activity page  (MainActivity}: java.lang.IllegalStateException: Hilt Activity must be attached to an @HiltAndroidApp Application. Did you forget to specify your Application's class name in your manifest's <application />'s android:name attribute? To resolve this issue, we need to add android:name=".GetHomeApplication" <xmlns:tools="http://schemas.android.com/tools"> <uses-permission android:name="android.permission.INTERNET" /> <application     android:name=".GetHomeApplication"     android:allowBackup="true"     android:dataExtractionRules="@xml/data_extraction_rules"     android:fullBackupContent="@xml/backup_rules"     android:icon="@mipmap/ic_launcher"

mongodb - creating database user in a cluster

Image
 While trying to create a database user but my admin control doesn't seems to have this options And the funny thing is when I create a new project entirely, this options is available to me

mongosh install properly

To install mongosh property on ubuntu 24.04, we need to wget -qO- https://www.mongodb.org/static/pgp/server-8.0.asc | sudo tee /etc/apt/trusted.gpg.d/server-8.0.asc Then run  echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu noble/mongodb-org/8.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-8.0.list Next we will run  sudo apt-get update And then finally install it using  sudo apt-get install -y mongodb-mongosh To verify if it is running we run  mongosh --version

python strawberry graphql error : "Field 'ReportInput.propertyType' of required type 'String!' was not provided."

Ran into this issue saying my field is not defined. Here is my input definitions  @ strawberry . input class ReportInput :     location : LocationInput     property_type : str     current_analysis : str And here is my graphql mutations: mutation {   saveReport (     report : {       location : {         suburb : " St Albans "         state : " Melbourne "         country : " Australia "       }       property_type : " House "       currentAnalysis : " Property analysis details... "     }   ) {     status     id     location     propertyType     currentAnalysis   } } As you may have noticed ' property_type ' is the same. However, in grapghql convert it to camel casing with it has delimiter "_". So changing the mutation as follows works....

android - java.net.UnknownServiceException: CLEARTEXT communication to 10.0.2.2 not permitted by network security policy

 Bump into this error when trying to initate a service request to  java.net.UnknownServiceException: CLEARTEXT communication to 10.0.2.2 not permitted by network security policy 2026-05-05 20:57:52.706  8867-8867  System.err              com.appcoreopc.getmyhome             W  at okhttp3.internal.connection.RealConnection.connect(RealConnection.kt:188) 2026-05-05 20:57:52.706  8867-8867  System.err              com.appcoreopc.getmyhome             W  at okhttp3.internal.connection.ExchangeFinder.findConnection(ExchangeFinder.kt:226) 2026-05-05 20:57:52.706  8867-8867  System.err              com.appcoreopc.getmyhome             W  at okhttp3.internal.connection.ExchangeFinder.findHealthyConnection(ExchangeFinder.kt:106) ...

kotlin - Trailing lambda syntax

This is really an eye opening moment for me to see this in Kotlin - where we can pass the last parameter in a function body. It is call trailing lambda syntax. In the example, I am passing the value "10" like this to the function sayHello.  fun main () {     println ( " Hello, world!!! " )     sayHello () { #1 way to call it         10     }     sayHello { 10} #2 another way to call it } fun sayHello ( name : String = " jeremy " , value : () -> Int ) {     println ( " $name: ${ value ()}" ) } It is a much cleaner way to call it.

python strawberry-asgi was not found in the package registry

Bump into this error while trying to run uv pip install .  Because strawberry-asgi was not found in the package registry and graphql-microservice==0.1.0 depends on strawberry-asgi, we can conclude that graphql-microservice==0.1.0 cannot be used. And because only graphql-microservice==0.1.0 is available and you require graphql-microservice, we can conclud that your requirements are unsatisfiable. And the solution I need to add " strawberry-graphql[asgi] " to my pyproject.toml  [ build - system ] requires = [ " setuptools>=61.0 " ] build - backend = " setuptools.build_meta " [ project ] name = " graphql-microservice " version = " 0.1.0 " dependencies = [     " strawberry-graphql[asgi] " , <---- Added this     " uvicorn " ,     " python-dotenv " ,     " google-cloud-aiplatform " , ]

google agents-cli for ADK - it is worth learning this

Image
This is quite a handy tool that we can use to work with ADK. It is newer than the adk tool and its repo can be found here https://google.github.io/agents-cli/guide/quickstart-tutorial/ Let's get started.  To create an agentic scaffold quickly (this will create basic agentic code, your private virtual environment, docker file, pyproject.toml, without CICD) agents-cli create my-agent --prototype --yes To create use agentic ADK, uses agentic_runtime (you can choose cloud run or GKE) and with github as the CICD agents-cli create my_agent2 -d agent_runtime  --cicd-runner github_actions --agent adk If you would like to get a base template, you can run the following command  agents-cli create my_agent2 -d agent_runtime  --cicd-runner github_actions --agent adk To add a new deployment target 🔥and other examples:- agents-cli scaffold enhance --deployment-target cloud_run # Add Cloud Run deployment agents-cli scaffold enhance --deployment-target cloud_run # Add a RAG datastor...

google adk create app from template command

This gotta be one of the most useful command in Google ADK template  uvx agent-starter-pack create my-retail-agent -a adk@retail-ai-location-strategy Other options include uvx agent-start-pack enhance uvx agent-start-pack extract uvx agent-start-pack list uvx agent-start-pack register-gemini-enterprise uvx agent-start-pack setup-cicd uvx agent-start-pack upgrade

creating a rust http testing client

This is an example of a rust http test client that i used to run test periodically.  use clap ::{ Parser , ValueEnum }; use indicatif ::{ ProgressBar , ProgressStyle }; use reqwest ::{ Client , Method }; use std :: collections :: HashMap ; use tokio :: time ::{ sleep , Duration }; // Added tokio sleep use serde_json :: Value ; #[ derive ( Copy , Clone , PartialEq , Eq , PartialOrd , Ord , ValueEnum , Debug )] enum HttpMethod {     Get ,     Post ,     Put , } #[ derive ( Parser , Debug )] #[ command ( author , version , about = " A simple HTTP load tester " )] struct Config {     /// HTTP Method to use     #[ arg ( short , long , value_enum , default_value_t = HttpMethod :: Get )]     method : HttpMethod ,     /// Target URL endpoint     #[ arg ( short , long )]     url : String ,     /// Number of tests to run     #[ arg ( short , long , ...

envoy - listener, route, cluster and endpoint

Image
          It become important to understand envoy mechanics and this is an awesome illustration of it and how these listeners and cluster and endpoints are linked together. 1. Listener (Where traffic enters) A Listener is a named network location (an IP address and a port) that Envoy opens up to accept incoming connections from clients. What it does: It's the "front door." It listens for incoming traffic, handles TLS decryption (if configured), and passes the request down the chain. In Istio: When you create an Istio Gateway resource and specify port 80 or 443 , Istio tells Envoy to open a Listener on that port. Real-world analogy: The receptionist desk at a building entrance. 2. Route (How traffic is matched) Once a request enters through a Listener, Envoy needs to decide what to do with it. This is where the Route comes in. What it does: It inspects the request details—like the URI path ( /html vs /status/200 ), HTTP methods ( GET , POST ), or he...