Ads similar to Duolingo pop up ads in Android Studio - Java - java

I am wanting my pop up ads to have a similar style to the Duolingo pop up ads. But I am not sure how to do it and can't seem to find any resources on this.
Would this be a separate activity with a smart banner? Or is there a way to customise ad mobs interstitial ads?
I haven't found any resources so far and thinking if I use smart banners in a seperate activity it would be complicated to handle as I will also be working with fragments and passing data between the 2 already existing activities / fragments. Also concerned smart banners will have a much lower ECPM than interstitial.

You could use a full-screen dialog fragment. This post completely explains the introduction. For the central box, use MaterialCardView and MaterialButton, or another container with a custom background.

Related

How to layout UI app android like facebook?

I saw some same topic here but can not find the anwser so I create my ask question.
I am a newbie in android and I am learning to build a layout by my self, I see facebook app and wonder how they layout UI with friend list behind main content. And when you click toggle friends main content will slide to left side and friends list show up.I try to use navigation drawer and viewpager but can not achive. I wrong something or it must use by other technique. Anyone can give some idea how to do that.
After two days, finally i found the answer by use a great this SlidingMenu.
https://github.com/jfeinstein10/SlidingMenu

How can I use ViewPager to display apps?

As the title states, how exactly can I use ViewPager to display a list of apps. Right now I'm using a GridView to display the list of apps on my device and it runs the app upon selection. However I wish to get a similar effect from launchers in the Play Store, the app drawer is split into different views and displays a set number of apps on one page. And when you swipe it goes to the second page and displays more apps.
How can I do this? At the moment I just have a simple GridView which can be scrolled up and down,
I have looked all around the internet and i have gotten no answers, I've taken a look at the aosp launchers src on github but it's too complicated to understand.
Thank to whoever answers my question.
You can use Jake Wharton's Android-ViewPagerIndicator in ViewPager to display your content. You can also try astutez's PagerSlidingTabStrip, it will me more suitable for your requirements. Implementation is very simple, you can also find the sample in the repository.

Shortcut for creating simple dialogs in Android

Android Newbie here! I spent all yesterday trying to implement a simple dialog in my android app. I realised there is no easy way out. I mean all i just wanted to show to user is a simple choice between importing a video into the app from the gallery or recording a live video. My Parent UI is already consisting of two fragments in a split-pane style(Details on the left, gridview on the right). Now i want to show the options for importing a video as a dialog. Turns out i have to create another fragment(DialogFragment), give the fragment a UI(ListView), create UI for the list items, create adapters for my list, override getView method for my adapter with custom logic. is there no shortcut to this? While this might make me sound lazy (which i'm not btw cos i love coding), what if i want to create 4 additional dialogs, do i have to do this everytime? is there no easy way out?
btw I'm targeting SDK 11 to 19 devices.
Any help will be very much appreciated.
Have you had a look at the AlertDialog.Builder?
You could use this to build your dialog and then set your click handlers on setPositiveButton and setNegativeButton methods if you only want two options.
It was added at API level 1.

How to embed app drawer / app launcher in Android Application

I'd like to embed the app drawer within an activity/layout in my android app. Has anyone seen an example of how this can be done?
I did a StackOverflow search and I wasn't able to find anything useful...
https://stackoverflow.com/search?q=app+drawer
Download DevApps Direct on your device. All the samples DevApps showcases are open source.
It has an example called "Sliding up Panel", with its code here.
But note that you'll also need to merge the code for this gridview example if you want to replicate the listing of the launcher icons in that panel just like the app drawer does.
I basically think this is a bad idea you shouldn't be launching other apps from inside your app unless it is a launcher. That said I've written a few. Grab my source here https://github.com/aospTV/TVLauncher-Gee

Android pattern for activity "flows"

I'm developing an android app that has a bunch of screens (activities) that are supposed to have "continue" and "back" buttons at the top. Can you tell me the right pattern for implementing this? I've seen some iPhone apps that have this but Android apps usually don't (I think partly because the back button is part of the phone).
I found a post online about an Activity class that has "sub activities" which kind of seems like what I want to do, but I'm wondering if there's a simpler solution or pattern for creating flows like this (in which several activities are linked with continue/back buttons).
You answered part of it yourself. There shouldn't generally be a software back button because android has a hardware back button. As for a continue button, that's extremely context dependant so it would probably be written in software based on the context.
No that doesn't sound like what you want. You're probably thinking of an activity group and from the very vague description of your design, you don't want those. There's no "simpler" solution or pattern to create flows like this because this is the exact default android behaviour.
Just start a new activity in your "continue" button, and the back button will finish that activity.
I'm developing an android app that has a bunch of screens (activities) that are supposed to have "continue" and "back" buttons at the top.
If you want to implement a wizard, use buttons at the bottom and do it as a single activity, perhaps using a ViewFlipper for the changing contents.
If this is not logically a wizard, just allow the BACK button to handle "back", and tapping on something meaningful to go forward, as a set of regular activities, like a regular Android application would.
In other words, please follow platform navigation conventions.
can you just open a new activity as per usual android development and make the back button call finish() you can set your theme to make the activity animate out like the iphone when finish is called.

Categories

Resources