Fran Navarro
Fran Navarro

Reputation: 41

Json Android: different activities or one class

I have a small doubt, I am developing an application with various activities that call a database via json, did right is to make calls in the same activity importing all packages in each activity or create an activity / service / class its functionality is the treatment of calls to the server?

Upvotes: 0

Views: 42

Answers (1)

Stan Smith
Stan Smith

Reputation: 906

Create a class that exposes your required service methods, then use that class in each Activity to communicate w/your server.

Upvotes: 2

Related Questions