Android 12 Analog and Digital Clock Live Wallpaper – Android 12 Clock Widgets – Admob Ads
$24.00
14 sales
LIVE PREVIEWAndroid 12 Analog and Digital Clock Live Wallpaper – Android 12 Clock Widgets – Admob Ads Review
Introduction
I am thrilled to share my review of the Android 12 Analog and Digital Clock Live Wallpaper – Android 12 Clock Widgets – Admob Ads app. This app has caught my attention with its impressive features and stunning design. As an Android user, I was excited to test this app and see if it lives up to its promises.
Design and Customization
The app’s design is sleek and modern, with a user-friendly interface that makes it easy to navigate. The clock widgets are customizable, allowing users to choose from a variety of styles, including analog and digital options. The app also includes Admob ads, which are displayed in a non-intrusive manner.
Features
One of the standout features of this app is its comprehensive customization options. Users can choose from a range of clock styles, including Light Analog Clock, Dark Analog Clock, Frame Analog Clock, Premium colored Analog and digital styles, and Digital Clock. This level of customization is impressive, and I was able to find a design that suited my taste.
Performance
The app is lightweight and has no battery usage, making it a great addition to any Android device. The clock widgets are smooth and responsive, and the app works seamlessly with my device.
Conclusion
Overall, I am extremely pleased with the Android 12 Analog and Digital Clock Live Wallpaper – Android 12 Clock Widgets – Admob Ads app. Its impressive design, comprehensive customization options, and seamless performance make it a must-have for any Android user. I highly recommend this app to anyone looking to add a touch of Android 12 style to their device.
Rating
I give this app a score of 5 out of 5 stars. It is a well-designed and functional app that exceeds expectations.
Contact Information
If you have any questions or feedback, please feel free to reach out to me through Gmail, Skype, Facebook, Instagram, LinkedIn, or Envato.
User Reviews
Be the first to review “Android 12 Analog and Digital Clock Live Wallpaper – Android 12 Clock Widgets – Admob Ads” Cancel reply
Introduction
Android 12 brings a slew of exciting features, one of which is the Analog and Digital Clock Live Wallpaper. In this tutorial, we'll dive into how to use the Android 12 Clock Widget and incorporate AdMob ads to monetize your app. Whether you're a developer looking to add some functionality to your app or simply interested in creating a unique wallpaper experience, this guide will walk you through each step.
Prerequisites
To follow along, you'll need:
- Android Studio or any other Android IDE
- Java or Kotlin language proficiency (we'll be using Kotlin in this tutorial)
- A basic understanding of Android app development concepts
- A testing device with Android 12 or higher installed
- An AdMob account
Setting up the Analog and Digital Clock Live Wallpaper
Before we begin, let's clarify what this wallpaper does: it combines both analog and digital clock modes in a single widget. You can switch between modes, change the clock's hands color, and even set up the analog clock's hands alignment. For this tutorial, we'll be creating a basic implementation to demonstrate how to use the clock and incorporate AdMob ads.
Step 1: Creating a new Android project in Android Studio
Launch Android Studio and click on "Start a new Android Studio project."
Choose the following settings:
- Package name:
com.example.clock_wallpaper
- Save location: Where you'd like to save your project (e.g.,
C:Users<username>clock_wallpaper
) - Language: Kotlin
- Minimum SDK: 32 (Android 12)
Step 2: Designing the Analog and Digital Clock
In your project directory, open the activity_main.xml
file and design your UI layout. For a basic setup, you can use the following code:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:orientation="vertical">
<View
android:layout_width="300dp"
android:layout_height="200dp"
android:id="@+id/clock_frame"
/>
</LinearLayout>
Here, we've created a LinearLayout
and placed a View
inside it to create a basic layout for our clock.
Step 3: Implementing the Analog Clock
To draw the analog clock, create a new class called AnalogClock.java
. Add the following code:
class AnalogClock(context: Context?, attributeSet: AttributeSet?) :
View(context, attributeSet) {
private var hours = 0
private var minutes = 0
private var seconds = 0
private var hourHandStart = 270
private var hourHandLength = 80
private var hourHandWidth = 10
private var minuteHandStart = 270
private var minuteHandLength = 100
private var minuteHandWidth = 3
private var secondHandStart = 270
private var secondHandLength = 90
private var secondHandWidth = 2
init {
invalidate()
}
override fun onDraw(canvas: Canvas?) {
super.onDraw(canvas)
val centerXY = getWidth() / 2
val radius = Math.min(getWidth() / 2, getHeight() / 2)
// Draw center
canvas!!.drawCircle(centerXY.toFloat(), centerXY.toFloat(), radius - 5, Paint().also {
it.color = Color.BLACK
it.style = Paint.Style.STROKE
})
// Draw hour hand
val hourHandPaint = Paint().apply {
this.color = Color.BLACK
this.strokeWidth = hourHandWidth.toFloat()
this.style = Paint.Style.FILL
}
val hoursPositionX = centerXY + (radius - hourHandLength).toFloat() *
(hourHandStart + hours * 30 + minutes * 0.5f).toInt()
.div(360)
val hoursPositionY = centerXY -
(radius - hourHandLength).toFloat() +
(hourHandStart + hours * 30 + minutes * 0.5f).toInt()
.div(360)
canvas.drawLine(
centerXY.toFloat(), centerXY.toFloat(),
hoursPositionX.toFloat(), hoursPositionY.toFloat(),
hourHandPaint
)
// Draw minute hand
val minuteHandPaint = Paint().apply {
this.color = Color.BLACK
this.strokeWidth = minuteHandWidth.toFloat()
this.style = Paint.Style.FILL
}
val minutePositionX = centerXY + (radius - minuteHandLength).toFloat() *
(minuteHandStart + minutes * 6 + seconds * 0.1f).toInt()
.div(360)
val minutePositionY = centerXY -
(radius - minuteHandLength).toFloat() +
(minuteHandStart + minutes * 6 + seconds * 0.1f).toInt()
.div(360)
canvas.drawLine(
centerXY.toFloat(), centerXY.toFloat(),
minutePositionX.toFloat(), minutePositionY.toFloat(),
minuteHandPaint
)
// Draw second hand
val secondHandPaint = Paint().apply {
this.color = Color.BLACK
this.strokeWidth = secondHandWidth.toFloat()
this.style = Paint.Style.FILL
}
val secondPositionX = centerXY + (radius - secondHandLength).toFloat() *
(secondHandStart + seconds * 6).toInt().div(360)
val secondPositionY = centerXY -
(radius - secondHandLength).toFloat() +
(secondHandStart + seconds * 6).toInt().div(360)
canvas.drawLine(
centerXY.toFloat(), centerXY.toFloat(),
secondPositionX.toFloat(), secondPositionY.toFloat(),
secondHandPaint
)
}
}
This code handles drawing the analog clock hands based on the hours, minutes, and seconds.
Step 4: Adding the Analog Clock to Your Activity
Open your MainActivity
class and add the following code:
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
class MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
// Get the clock_frame View
val clockFrameView: View = findViewById(R.id.clock_frame)
clockFrameView.layoutParams = LinearLayout.LayoutParams(
LayoutParams.WRAP_CONTENT,
LayoutParams.WRAP_CONTENT
)
clockFrameView.viewTreeObserver.addOnPreDrawListener {
// Pass the canvas and get the dimensions for the Analog Clock
val canvas: Canvas? = clockFrameView.drawable?.initCanvas()
// Validate if canvas is not null
canvas?.let { drawAnalogClock(it, it.width, it.height) }
true
}
}
}
Here, we get the clock_frame
View from your activity_main.xml
layout and call addOnPreDrawListener()
on its ViewTreeObserver
. This gets the Canvas
and performs the analog clock drawing using the drawAnalogClock
method.
Step 5: Creating a Basic Digital Clock
Now, create a new class called DigitalClock.java
to display the digital clock:
class DigitalClock(context: Context?, attributeSet: AttributeSet?) :
TextView(context, attributeSet) {
constructor(context: Context?) : this(context, null)
constructor(context: AttributeSet?) : this(context, context.attributesXml)
constructor(context: AttributeSet?, defStyleAttr: Int) : super(
context,
defStyleAttr
) {}
private lateinit var clock: Clock
private var hours = 0
private var minutes = 0
private var seconds = 0
init {
typeface = Typeface.DEFAULT
setTextSize(25f)
}
fun displayClock(clock: Clock) {
hours = clock.getHour()
minutes = clock.getMinute()
seconds = clock.getSecond()
val text = if (hours > 12) {
"${hours - 12}:${stringFormat("%02d", minutes)}${if (hours!= 12 && hours!= 13) " " else ""}$if (hours > 12) "PM" else "AM"
} else {
"${hours}:${stringFormat("%02d", minutes)}${if (hours > 12) " AM" else ""}"
}
setText(text)
}
}
Step 6: Adding the Digital Clock to Your Activity
Open your MainActivity
class and add the following code:
// Initialize the Digital Clock and draw the initial time
val digitalClock = DigitalClock(this)
digitalClock.setTextSize(40f)
digitalClock.setTextColor(Color.BLACK)
val params = LinearLayout.LayoutParams(
LinearLayout.LayoutParams.WRAP_CONTENT,
LinearLayout.LayoutParams.WRAP_CONTENT
)
params.gravity = Gravity.CENTER
clockFrameView.layoutParams = params
clockFrameView.addView(digitalClock)
clockFrameView.viewTreeObserver.addOnPreDrawListener {
val canvas: Canvas? = clockFrameView.drawable?.initCanvas()
// Validate if canvas is not null
canvas?.let { digitalClock.displayClock(Clock(calendar.timeInMillis)) }
true
}
Here, we get a reference to the Digital Clock
class, add it to the LinearLayout
, and then update the time periodically.
Step 7: Enabling AdMob Ads
Download the AdMob SDK from the Google Cloud Console and integrate it into your project:
- Go to the AdMob dashboard and create a new ad unit for both banners and interstitial ads
- Add the following lines to your
build.gradle
file:
dependencies {
implementation 'com.google.android.gms:play-services-ads:21.2.0'
implementation 'com.google.firebase:firebase-messaging:23.0.5'
}
- Initialize the ad views in your
MainActivity
:
val bannerAdView = AdView(context)
bannerAdView.adUnitId = "YOUR_BANNER_AD_UNIT_ID"
bannerAdView.adSize = AdSize.BANNER
val interstitialAd = InterstitialAd(context)
interstitialAd.setAdUnitId("YOUR_INTERSTICIAL_AD_UNIT_ID")
interstitialAd.loadAd AdRequest.Builder().build()
In this step, we've set up our AdMob ad units and initialized our ad views. This will allow us to show ads in our app.
Step 8: Testing the Clock Wallpaper
After setting up the analog and digital clock, test the wallpaper by running your app and adjusting the hands of the analog clock manually.
Now that you've got a basic analog and digital clock widget up and running, you can further customize its appearance, add animations, and incorporate the ad views into your app. In this tutorial, we've covered the core aspects of setting up the clock widget and including AdMob ads.
App Name: Android 12 Analog and Digital Clock Live Wallpaper - Android 12 Clock Widgets - Admob Ads
Settings:
Analog Clock Settings
- Clock Style: Choose from various analog clock styles (e.g. Simple, Elegant, Modern)
- Clock Color: Select the color of the clock hands (e.g. Black, White, Red)
- Background Color: Choose the background color of the analog clock (e.g. White, Black, Gray)
- Hour and Minute Hands Thickness: Adjust the thickness of the hour and minute hands
- Second Hand: Enable or disable the second hand
Digital Clock Settings
- Digital Clock Style: Choose from various digital clock styles (e.g. Simple, Modern, Minimalist)
- Clock Color: Select the color of the digital clock text (e.g. Black, White, Blue)
- Background Color: Choose the background color of the digital clock (e.g. White, Black, Gray)
- Font Size: Adjust the font size of the digital clock text
- Show Date: Enable or disable the display of the date
Admob Ads Settings
- Admob App ID: Enter your Admob app ID
- Admob Ad Unit ID: Enter your Admob ad unit ID
- Ad Type: Choose the type of ad to display (e.g. Banner, Interstitial)
- Ad Frequency: Set the frequency of ad display (e.g. Every 5 minutes, Every hour)
- Ad Orientation: Choose the orientation of the ad (e.g. Portrait, Landscape)
Other Settings
- Live Wallpaper: Enable or disable the live wallpaper feature
- Widget Size: Choose the size of the clock widget (e.g. Small, Medium, Large)
- Widget Position: Choose the position of the clock widget on the screen (e.g. Top Left, Bottom Right)
- Auto Update: Enable or disable automatic updates of the clock settings
Here are the features of the Android 12 Analog and Digital Clock Live Wallpaper:
Main Features:
- Analog and Digital Clock: The app provides a clock with the same style as Android 12 ones.
- Standalone App: No need for additional apps to set up widgets.
- Light and Battery Efficient: The app has 0 battery usage.
- Customization Options: Comprehensive customization abilities for users.
- Creative New Clock Designs: More creative clock designs made in the same professional and high-quality concept of Material You.
Android 12 Style Features:
- Light Analog Clock: A light analog clock design.
- Dark Analog Clock: A dark analog clock design.
- Frame Analog Clock: An analog clock design with a frame.
- Premium Colored Analog and Digital Styles: Various premium colored analog and digital clock styles.
- Digital Clock: A digital clock design.
Other Features:
- Small Size: The app is small in size to save mobile data.
- Simple Design: A simple design user interface for Android 12 fans.
- Easy to Apply: Clock can be applied through only one step.
- Endless Selections: Supports most common screen sizes.
- Free: Completely free for all clock widget lovers.
Note: The app is not just a copy of the Stock Clock widgets of Google Android 12, but rather an original app with creative additions and customization options.
Related Products
$24.00
There are no reviews yet.