Click here to Skip to main content
15,886,806 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
Hello

I want to create a space for the user to add some events or information about him to be displayed in his profile section on the mobile application.

what is the best way to create this function for user and how should i send the information to the mobile app. "in what json format?"

The User function:

- He can add Text + Images + links( URL, Email, Phone)
- He Can Format the text As (Bold, Italic, Underline)
- Image May have Captions

Note: Im responsible for the web part only ( Front end and web service )

Your Help is appropriated thanks.
Posted

1 solution

The question makes little sense, really, because it all depends on your mobile application and because you did not formulate requirements and did not explain any particular problem.

Well, for formatted text, you can use HTML or XML using HTML markup, just to save time on inventing something on your own. But HTML along will not be enough, because you would need to send images. Images are not sent in HTML, they are sent separately, through URLs and separate HTTP requests, but you would need to pack images with your data. Images should be binary data (except vector images, which can be embedded using SVG or XAML, XML-based formats; but I suspect you mean pixel images). So you have to create a format on top of XML, to combine it with XML and/or HTML.

One such format already exists: e-mail message format. The images are packed as separate parts which you can reference inside the mail message using special URL scheme "cid:". Please see my past answer: Sending HTML attachment with images[^].

The only problem with mail message format is that images (and many other kind of parts using different MIME types) use base-64 format over the binary, which takes more space (this was done because mail message format is based on pure text). So you can think of something else, with less complexity than mail message format, but you could binary format for images.

Besides, you need to develop some application-layer protocol and implement it on both sides. It can be implemented on top of TCP and the implementation can use Java sockets. You can also use, for example, FTP. Please see:
https://en.wikipedia.org/wiki/Application_layer[^],
https://docs.oracle.com/javase/tutorial/networking/sockets[^].

—SA
 
Share this answer
 
v2
Comments
Mohibur Rashid 5-Aug-15 0:50am    
Two good points you said.
1. define the requirement properly.
2. Base64 for Binary
Sergey Alexandrovich Kryukov 5-Aug-15 1:41am    
Thank you, Mohibur.
—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900