I want to show WebView element inside home screen widget in Android. Where I gonna show HTML window from specific web-page. Already tried to make one using RemoteViews, but according to docs I can not use all view elements inside RemoteView.
Is any possibility to somehow render HTML page inside home screen widget in android ?
I want to show WebView element inside home screen widget in Android
That is not possible, sorry.
Is any possibility to somehow render HTML page inside home screen widget in android ?
Not in any practical fashion.
Related
I have some parts of the screen that stay permanent and one part of the screen which is a container that should change its content to one of a set of Card elements, according to a button press on a button group.
If I understand correctly I cannot use the Tab-Navigator (or the Stack-Navigator) because those control a full page (i.e. screen) change, and I only want to swap a single card element.
Am I correct about that?
If so what do I need to do? Is there some existing UI element for this? If nothing exists, how would I go about doing this? Each card loads different stuff from a local json, and I don't want to reload them when switching back and forth...
I want it to have the effect shown in Android UI (non react-native) samples: android Navigation Tabs in middle of screen
Perhaps I should be using swiper like in this answer? implement tabs in the center of the screen .
You can use a tab navigator, think about a structure like the one below
<View>
<OtherStuffThatFilLTheScreen>
<TabNavigator>
<OtherRandomStuff>
<View>
Tab navigator will have full control of the element that renders inside its space, but will not change other elements outside its scope
I am building an app where in a Detail Activity I have to show a web page.
I was going to use WebView, but then I saw Chrome Custom Tab.
What do you guys think it's better to implement and why?
If you just want to show a certain page then I would suggest you use chrome custom tabs. You can style the toolbar in a way it resembles your app style and they are intended for showing content without you having to worry much about anything else.
if you want to have full control over what the user is doing inside this website you have to use a webview. (you can prevent the user clicking links on the webview, you could intercept data the user inputs into controls on the website...)
But this can also be a negative aspect since the user really has to trust you that you don't log his data or even fiddle with it.
summary: "The WebView is good solution if you are hosting your own content inside your app. If your app directs people to URLs outside your domain, we recommend that you use Chrome Custom Tabs"
-> If it isn't your website you probably should go with custom tabs.
https://developer.chrome.com/multidevice/android/customtabs#whentouse
Webview : If you want your own content which has click listeners and data interception you need to go to webview. But It wont share the state with the browser.
Chrome Custom tab : If You are just redirecting to a url, i prefer chrome custom tab. But it has little cons too. We wont change its title text color where we can change the titlebar color. The text color will be chosen by the theme color only. And We can add actions, but we cant change the overflow menu icon or the entire actions displayed in the overflow action.
Even though the limitation are not a big deal. I recommend chrome custom tab over webview.
I've problem, that i want to create a home screen widget with listview inside, which should be scrollable. I read on docs page, that listview is only supported in remoteview from 3.0 android.
But still i think, this is not completely true, or i am missing something. Ok, when i tried do add listview to my home screen diget, i get error: class not allowed to be inflated android.widget.listview. BUT on my phone i have android 2.2.3 and i am able to add home screen widget (its some email application widget) which shows SCROLLABLE list of my emails, look here:
http://i50.tinypic.com/2gslq2q.png
And my question is: How is this possible and how to do it, in which way? Im googling few hours, but have absolutely no idea how is this possible (maybe dynamically generate items int vertical linear layout and create manualy scroller on right side, but it sound terrible complicated).![enter image description here][1]
EDIT: maybe its possible to generate long list of items into linear layout and detecting, if user is moving up or down with finger...
I read on docs page, that listview is only supported in remoteview from 3.0 android.
Correct.
i am able to add home screen widget (its some email application widget) which shows SCROLLABLE list of my emails
That is not an app widget. That is a feature of that home screen implementation.
maybe its possible to generate long list of items into linear layout and detecting, if user is moving up or down with finger...
No, sorry.
I want to implement a design as visible in the following picture:
In the main you can see the small views. When you click one it maximizes to full sceen.
How do I implement this in Android?
There are multitude of ways you can implement this.
one way is to have the 4 contents as imageButton and when you click on it , it open a new activity which shows the content in fullscreen.
or you can use a tableLayout instead of imageButton
You could do it with images on the main screen, within say a gallery or grid view, that when each is touched, opens a new activity based on the image touched.
Links are to google android developers pages, showing information on the available view types and how to open an activity.
I am building a home screen widget and I want to add an advertisement to it. Currently the advertises SDK provides a custom view widget which I tried to embed in my home screen widget. But when I add it, it says problem loading widget. I'm guessing I can't add custom views to a widget? Could someone clarify or tell me how I could add an advertisement to my home screen widget.
Thank you
Home screen widgets support very limited number of standard widgets. You can't use custom widgets for them. See App Widgets.