1

Topic: How to transfer object from android library in android app

Is Android Library at which is Context the calling application. In library there is an object how it to transfer in the main application?
Tried to transfer object through SharedPreference with serialization in json, but it did not turn out.

2

Re: How to transfer object from android library in android app

nikomp wrote:

In library there is an object how it to transfer in the main application?

What object? About its class know both application and library?

3

Re: How to transfer object from android library in android app

wadman;
The object forms in library, in application there is a link to library, application does not know about the object.

4

Re: How to transfer object from android library in android app

In library the object not in itself forms?
The library is used by application and function for reset of any object from library to application can quite be used.
Since I do not see in it a problem therefore I specify: what complexities which are not described in the initial message here is?

5

Re: How to transfer object from android library in android app

wadman;
And an example of such function it is possible?

6

Re: How to transfer object from android library in android app

Any global buffer is necessary to me to save there object. SharedPreference not to approach since is not able to store objects, before their saving it is necessary  in . I tried to make it with usage Gson, but the error out of memmory takes off

7

Re: How to transfer object from android library in android app

nikomp wrote:

any global buffer is necessary To me to save there object. SharedPreference not to approach since is not able to store objects, before their saving it is necessary  in . I tried to make it with usage Gson, but the error out of memmory

takes off
Why it is impossible to transfer object as object?

8

Re: How to transfer object from android library in android app

Probably I not completely described the task.
So, there is an application (App). There is a library (Lib). There are separate (Mod units, which  in App through ClassLoader.
In Mod objects from Lib are used. It is necessary to learn to exchange objects between separate Mod.
Probably I dig not in that side, can and it is not necessary to transfer objects in App.

9

Re: How to transfer object from android library in android app

All the same there is no information... As how became? What for? Why it did not turn out?
Therefore I will simply give the reference where known methods are described some: https://stackoverflow.com/questions/487 … activities

10

Re: How to transfer object from android library in android app

wadman;
Thanks for the link!
made on one of the methods described in your link, namely https://stackoverflow.com/questions/714 … re-object.
Certainly it was necessary to process saved objects.
The matter is that initially at me the object was a superstructure over the Card.

public class MyMap {
public Boolean isEditMode =false;
public String test;
public int id;
public MapView map;
..................

And Gson it was simply bent at attempt  this object in json. After from properties of object removed
public MapView map the object was saved in json.

11

Re: How to transfer object from android library in android app

And generally if at me the object is created in one Mod (module1.jar) and should be is visible to another Mod (module2.jar) it it is possible to transfer only through  on a disk  (, SP, files)?

12

Re: How to transfer object from android library in android app

Under my link and about  was (intent).