How to make an interactive activity which can be updated regularly? - android

I want to make a UI which can be updated regularly without updating the app itself (I want to make an event announcer meaning that every event the admin make the activity should be updated with the latest event)
Well I have an idea how to do this by making a page on my website and view it using a webview. So my question is? Is there a better way to do that other than this? Will suggest how or just link me to website or even give me a keyword to search it.
Everything is appreciated.

As the question is ambiguous! But look for Handlers.
Define a fixed interval where you can refresh the UI by giving the delayed messages!

Related

Android: make a post to a webservice every X minutes

I've seen some people with this same issue, however my case is a little bit different. The app must call a web service every X minutes no matter what fragment or activity is currently open. However all the cases I've seen here they give an option that works while on the same activity.
Edit: most work as a background job
You can use Firebase Jobdispatcher to implement what you need
Refer this

Why do we need pull to refresh for mobile app?

I'm wondering why I still see a lot of apps (including fb & instagram) that use pull to refresh feature for updating content? I mean, they have notification system that can tell itself to refresh when there's new data. I see that FB for instance it has little bubble in the news feed section that tells me i have new feeds up there and it can take me to it if i press it, but the pull to refresh functionality is still there. Why?
This is a great question. I'm interpreting it from the perspective of user experience.
Fast Company did an interview with Kevin Systrom a few years ago when Instagram added pull-to-refresh. He wasn't into the idea.
Systrom feels the gesture, which enables mobile users to refresh their photo feeds with a simple tug of the thumb, is a superfluous addition to his app, a relic of another smartphone era. "I don’t believe there should be refresh buttons," he says.
You're right that applications don't need to provide manual refresh capabilities. I'd say that pull-to-refresh and other user initiated actions fall under a category of interfaces that return agency to users, rather than relying on automatic processes to accomplish a task — in this case, refreshing content.
There are a few questions a user might ask if pull-to-refresh was removed from the examples you've given.
How do I get new content?
How often does this content refresh?
Does the user know that the content is automatically kept up-to-date? Do they trust that it's being refreshed quickly and consistently?
Nielsen Norman Group wrote a post late last year about visibility of system status, particularly that progress indicators contribute to a positive user experience by reducing uncertainty. I'd extend this research to pull-to-refresh and related interfaces. Maintaining a user's ability to manually perform an action that fetches new content covers two of Nielsen's ten usability heuristics — visibility of system status and user control and freedom.
In this light, a user who engages pull-to-refresh has a particular mindset: I want the latest data, and I want it now. Necessary or not, allowing them to manually refresh may be contributing to an improved user experience.
FYI: Pull to refresh was first used by Loren Brichter in the app Tweetie 2 which was acquired by Twitter later.
I think his answer to how he had implemented Pull down to refresh
gesture would be an apt answer for you question
Tweetie 2 simply took this idea from Tweetie 1, that reloading was
simply “loading newer”, and “loading newer” put new messages at the
top of the list… and activated the action based on a finger motion
that you were already doing. Why make the user stop scrolling, lift
their finger, then tap a button? Why not have them continue the
gesture that they are already in the process of making? When I want to
see newer stuff, I scroll up. So I made scrolling itself the gesture.
The gesture is only half the battle though, you need appropriate
feedback. Once the reload is activated, the scrollable area of the
list actually changes to leave the feedback UI in-place (rather than
bouncing offscreen). Without this part, the UI is unintuitive. And
once the loading is complete, the UI makes itself disappear.
Reference
It's usually better for a user to choose when to update the the news feed "like on the Social Apps".
Since its not usually good to update the content automatically when the user is still reading it.This can bring about confusion to the user.
And the pull to refresh is a qualified feature for doing the work
Also this is to save mobile data usage especially in countries where internet is expensive
Simple point by considering google's Do and Don't
Swipe-to-Refresh can be used to One-phased loading.We can use other type
progress bars ie , circular etc for loading content for the first
time and load and display all content at once or loading items when
scrolls .
You can understand the purposes clearly by going through this
In my opinion this UI component is an equivalent of refresh button which does not occupy any space and it is user friendly because join scrollable + force refreshing + loading animation + finish event
It is up to app's team to determine should they use it or not based on their possibilities
your question is Awsome.. i have some R&D on it.
see nowadays reach apps never use pull to refresh in android. because android have service that can run in background with wack-lock.
but ios have no background service.
service always consume battery best way when app is open you can one time use service and after than stop service and use swipe to sync or refresh.
hope u get some idea about it.
i have one Link for more about it.see comments that can open you for this point.

Possible to integrate while loop into Android studio network connect?

I am facing a small issue with the android studio net work connect sample code.
Basically the code does exactly what i need, Press a button, it will fetch raw html a predetermined http.
However i was wondering if it is possible to make a while loop such that i do not need to press on the fetch button every time i want to get the data.
Regards.
http://developer.android.com/samples/NetworkConnect/index.html
What do you want exactly ? Do you want to refresh the web page or to check network connection ?
It seems you looking for refreshing the web page some period time.
While loop doesn't make sense. I suggest you to use Thread Handler or Timer.
Refer this link
you may get some ideas.

How do I get Android to dynamically refresh a url

I have used the Udacity Google Developing Android Apps tutorial and other sources to get my application to fetch an XML file in HTTP via an AsyncTask and display it via a ListAdapter.
Now I am trying to eliminate the refresh button and have it update when the app starts, and then at intervals afterwards.
As far as I can tell, even though the code at Udacity creates a Service, it doesn't eliminate the refresh button.
The code at http://www.vogella.com/tutorials/AndroidServices/article.html#exercise_bindlocalservice only refreshes when the list is clicked.
Does anyone have sample code where the list auto refreshes?
yourListAdapter.notifyDataSetChanged();
or you can use activity life cycle to update the activity through onResume() or onStart() if needed! but i guess you are looking for the first answer to refresh ur listAdapter
if your auto means the content will update whenever there are new contents. You should check those new content by yourself , the classical way is set a Timer to check it . After you got the new content , you can use them to update the view .
Update:
See this:http://www.vogella.com/tutorials/AndroidTaskScheduling/article.html
The reason for not using Timer is not because Timer does 'bad things' but Android does, All running task or data will be stopped and recycled by Android's GC at anytime , so the Timer will be terminated at anytime.
If you have a service or an activity in your application which should perform a repetitive task you cannot reply on a TimerTask or similar approaches and control it from your Android component. Activities and services can be terminated at any point in time by the Android system to free up resources.
So , you can rely on AlarmManager or JobScheduler in the tutorials I post above.
All my questions were answered by using the BasicSyncAdapter example from Google.

Updating the app at exactly midnight

Is there a way to cause my app to update itself at exactly midnight every night? I need the new content to be displayed on the app right when it hits midnight. I have an idea of how to accomplish this, but if it isn't in another thread and is in the onCreate and the app is running in the background next time it is opened it would just display the previous info and not the updated?
I could also use help accomplishing this same thing with iPhone as well.
I will clarify a bit. So all the information that is to be displayed on the app will be in the app already. I simply want the content (whats displayed) on the app to randomize and then display the new group of content only once per 24hours or at exactly midnight. Hope that makes it more clear.
Android:
You can set pre-determined times to update with AlarmManager
You can look at a snippet here: Android: How to use AlarmManager
iPhone:
With iPhone you probably have to download the content whenever you re-open the app.
Can't you just have the app update the content upon launch, or when entering the foreground in the appDelegate.
This question is very vague - but if I understand the requirements correctly you will need to serve the application's content dynamically via a content server (or some type of a CDN). In this case there could be various scenarios.
In the easiest possible implementation, you could have the application be powered by data (XML, JSON, etc...) from something like Amazon S3 and have logic within the application to know how to fetch the correct data depending on the current day.
This wouldn't be extremely difficult to implement, but it would require building some type of cross-platform framework that reads the same kind of data for each application.
Is the content available before midnight?
If so, can't you have the app download it in the background beforehand and then make it available exactly at midnight?
If not, there's surely going to be some delay anyway.
app can not update itself at least in iOS apps.

Categories

Resources