Questions tagged [otto]

Otto is an event bus designed to decouple different parts of your application while still allowing them to communicate efficiently. It is designed with Android-specific use cases in mind.

Otto is an event bus designed to decouple different parts of your application while still allowing them to communicate efficiently. It is designed with Android-specific use cases in mind.

Forked from Guava, Otto adds unique functionality to an already refined event bus as well as specializing it to the Android platform.

186 questions
0
votes
1 answer

Error when using the library Otto

I'm trying to deal with the library Otto and try an example here and I was able to run the example. But I want to work with components, for which I was a little altered example and got the error MainActivity: public class MainActivity extends…
0
votes
1 answer

Android Service for communicating with server

I need the service to have a steady connection with the server. Activity and service should have bi-directional communication. Here are the options I know Use intent service Extend Service class ( make it run in a different process ) and…
0
votes
0 answers

Retrofit, Otto and storing models in RAM

In our project we are forbidden to store data from server (confidentional information). But once downloaded and parsed models are used in multiple fragments. Data on server updates once a day and forced logout occurs in midnight. I want to store…
anisart
  • 1,747
  • 2
  • 13
  • 15
0
votes
1 answer

Delivering updated list elements via an otto event to Mortar's screen

I'm trying to use Mortar for a simple application that shows a list of items based on mortar-sample. I'm using Retrofit/Gson to fetch meta-data of these items and Otto to deliver updates to the view once the items are downloaded. I'm also using…
bachr
  • 5,780
  • 12
  • 57
  • 92
0
votes
1 answer

Making data accessible to fragments

I am having an app which is retrieving data in the main activity and sending an event to all fragments as soon as it is available. So for the first start it looks like this: App starts (fragments are initialising in the background) -> feed download…
stoefln
  • 14,498
  • 18
  • 79
  • 138
0
votes
1 answer

What is the nicest way to use Otto (or simply callback design pattern) if i also want to pass data?

My concern is that isn't creating an own class for each and every unique event considered bad practice? Feels like this approach is not sophisticated, even more so if i have dozens of events. Although it's an easy solution (unique fields for every…
chrystolin
  • 1,067
  • 1
  • 9
  • 17
0
votes
1 answer

Is an Event Bus (Otto or Greenrobot) dependant on the onCreate*()-callbacks?

I have a specific question concerning the event bus design pattern in combination with androids activities/fragments/services. What I understood so far: When using an event bus I create, lets say, a single event bus for my whole application…
Spyro
  • 159
  • 1
  • 13
0
votes
2 answers

Change image in unfocussed ViewPager Fragment

So I have a view pager implemented like this In the main view I have button at the top right of the screen thats similar to a navigation bar. When I click it or swipe it I want it to disappear and when it refocuses on the main screen I want it to…
Will Jamieson
  • 918
  • 1
  • 16
  • 32
0
votes
1 answer

Otto: Fragment subscriptions not receiving events

I've got a fragment and have registered and unregistered the bus in the fragments onResume and onPause methods. Using the following BusProvider.getInstance().register(this); and BusProvider.getInstance().unregister(this);. I have a subscription…
camelCaseD
  • 2,483
  • 5
  • 29
  • 44
0
votes
1 answer

Square's Otto and Threads

I have an Otto question. I have a Runnable thread that I kick off. It does some processing and posts the result as an event on the bus. Within the Runnable class, the bus is retrieved by calling the getInstance of this class: public final class…
Perry Hoekstra
  • 2,687
  • 3
  • 33
  • 52
0
votes
1 answer

Otto runtime exception

My app uses Otto all over the place but I am consistently running into the same Runtime Exception crash. This is happening with several different events and that makes me think I am not implementing otto correctly. I am using the Main Thread Bus…
SamIAmHarris
  • 2,158
  • 3
  • 16
  • 19
0
votes
1 answer

Activity with Long running task

I am developing an android app which does a long running task either invoked by user or scheduled by Alarm. I have designed it in Activity - > Service - > AsyncTask form of invocation. I use the Otto library to bring UI updates directly from the…
Madhur Ahuja
  • 22,211
  • 14
  • 71
  • 124
0
votes
2 answers

Gradle can't find library

I am trying to include Otto library in my project, but am getting this error: > Could not resolve all dependencies for configuration ':maptest:_debugCompile'. > Could not find com.squareup:otto:1.3.4. I have tried cleaning project, running Tools ->…
vampireLady
  • 137
  • 3
  • 17
0
votes
2 answers

The performance of sync post in Otto (Event bus)

I used Otto for the event bus in my app. I went through square.github.io/otto. It said 'Posting to the bus is a synchronous action so when program execution continues it is guaranteed that all subscribers have been called.' I am curious why it does…
Joe C
  • 2,757
  • 2
  • 26
  • 46
0
votes
1 answer

What is events in Otto and are there types of events that could be published using OTTO?

Iam just a bit confused with what type of events can be published through OTTO. and a example of event class will be really helpful. Thanks
Avijeet
  • 1,031
  • 1
  • 10
  • 27
1 2 3
12
13