Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6371895
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T01:09:09+00:00 2026-05-25T01:09:09+00:00

My Activity starts an IntentService that then calls a remote API. I then need

  • 0

My Activity starts an IntentService that then calls a remote API. I then need to pass the resulting data back to the Activity (through a BroadcastReceiver). Within much of the rest of the app this data is encapsulated in a single class, with primitive member variables holding the data. But as the results are passed across through an Intent I’m limited in my options as I can’t pass a standard Java object across the boundary. I am looking for a neat and tidy way to pass objects like this through an Intent, without requiring large amounts of repetitive code needing to be written.

Options:

  1. Implement Parcelable on my class. Tedious to implement/maintain
  2. Pass each member variable individually, and reconstruct the object on the other side. Tedious to implement/maintain
  3. Use AIDL to specify the contract. Never done it before, not sure how appropriate this is.
  4. Serialise the object and pass the String through to the Activity. Is there a String length limit for passing through an Intent? I gather there can be performance issues.

Which approach should I use, and why?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T01:09:11+00:00Added an answer on May 25, 2026 at 1:09 am

    Does this remote API serialize the data in some way (JSON or XML)? Can you not hold off on the deserializing until it reaches the Activity?

    Failing this I would see serialization as the best option. Parcelable is a specific type of serialization which, as you point out is a little more tricky to implementent but should be more performant if you are concerned about performance. Unless you are handling a huge amount of traffic, though, the serialization option shouldn’t be too sluggish in my experience.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a method that I need to run when the activity starts. I've
How can I pass data from a threaded service to the activity that created
Hey I am working on app that need to pass variable receive from broadcastreceiver
I have an activity that schedules an operation to an external API and then
I need help with this situation: I have activity, what starts IntentService. Service do
I have an activity that starts after a certain time. Once this activity starts,
I wrote some code that activity starts a service to get some text from
I need to display a certain view when an activity starts, and when the
So I have a very simple android activity that starts a timer when you
I have an single Activity application that starts a Service and binds to it.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.