MacInsiders Logo

Similar Threads
Thread Thread Starter Forum Replies Last Post
Wind Mobile macbaby07 General Discussion 10 08-15-2011 06:56 PM
virgin mobile? SciMania General Discussion 22 05-11-2011 11:42 AM
Wind mobile? Linh Computers & Tech 41 09-06-2010 06:44 PM
wtf is wrong with googles gmail client? Ownaginatios Computers & Tech 7 08-11-2010 01:35 AM

MI mobile chat client (dev thread)

 
Old 01-26-2013 at 11:25 PM   #1
Afzal
Android Dev
Join Date: Jun 2009
Posts: 1,604

Thanked: 114 Times
Liked: 414 Times




MI mobile chat client (dev thread)
I'm creating this thread to discuss some things about MI Chat and hopefully start an effort to develop a native Android client (we could consider other platforms later).

Basically, this is how the app would be laid out in the beginning:

- Main activity, showing the ever-populating list of chat messages and post them
- A service, to load new messages in the background if the app is left open
- Depending on the API, probably a ContentProvider to maintain a local database of requests to the server (could probably be cleared after every session)

The architecture of the app will mostly be based on this implementation of an Android REST client, https://github.com/aug-mn/restful-an...ee/catpictures

I know Ownaginatios has developed an API so hopefully if we get that code, it will cut down some work. Otherwise we'll need to figure out what requests to make to the server before anything else. If we can have the server response be anything but the whole page source, that would be brilliant.

To try out HTTP requests to a server, use the Postman app for Chrome.

Anyone who wants to help can post in this thread, once we have an idea of the requests we need to make, I'll start a repository and start with a skeleton to build upon.
__________________
Afzal Najam - Honours Computer Science grad
Old 01-27-2013 at 09:06 AM   #2
Ownaginatios
Trolling ain't easy
Join Date: Jul 2008
Posts: 3,190

Thanked: 499 Times
Liked: 1,642 Times




Here is a link to what I've got so far: https://dl.dropbox.com/u/13297304/mec.tar.gz

All it really does is handle the logging in, sending and receiving messages. It wraps messages into a Message class with all the info the chat client sends as well as the list of users.

What it doesn't handle is getting kicked, logging out, muting or any of the admin functionality (mostly because I just never had the opportunity to look into it). It shouldn't be too hard to add that stuff in I don't think. Logging in is what took a while to figure out :/.

And yes, the responses aren't the whole page source .

Also, I used some Apache Commons thing to do the HTTP REST calls which really sucks. You may want to replace it with something else, lol.

That'd be cool to setup a git hub or something and have anyone on the forum interested make contributions.
__________________
Dillon Dixon
Alumni
Software Engineering and Embedded Systems
Old 01-27-2013 at 10:19 AM   #3
Chad
MacInsiders Founder/Admin
MacInsiders Staff
Join Date: Sep 2006
Posts: 7,121

Thanked: 1,202 Times
Liked: 1,730 Times




Fantastic! I will check it out.
Old 01-27-2013 at 05:48 PM   #4
Afzal
Android Dev
Join Date: Jun 2009
Posts: 1,604

Thanked: 114 Times
Liked: 414 Times




This is great Dillon! All the data is already in XML.

Here's the repository:
https://github.com/AfzalivE/MI-Chat

It has your code as well, if there's a license you want it to be associated with, please let me know.

Feel free to fork, modify and do a pull request.
__________________
Afzal Najam - Honours Computer Science grad

Chad, Freija all say thanks to Afzal for this post.

Chad, Ownaginatios like this.
Old 01-28-2013 at 07:39 PM   #5
Afzal
Android Dev
Join Date: Jun 2009
Posts: 1,604

Thanked: 114 Times
Liked: 414 Times




Dillon, how do we plan to persist session over multiple days? All these cookies expire the next day.

Persisting the session over multiple app instances is easy, just store the cookies in SharedPreferences.
__________________
Afzal Najam - Honours Computer Science grad

Chad likes this.
Old 01-28-2013 at 08:43 PM   #6
Chad
MacInsiders Founder/Admin
MacInsiders Staff
Join Date: Sep 2006
Posts: 7,121

Thanked: 1,202 Times
Liked: 1,730 Times




This is great guys! What's the next step, how can I help?

The Chat plugin used is https://blueimp.net/ajax/ which you could pick apart to see how the admin functionality works.

Afzal says thanks to Chad for this post.
Old 01-28-2013 at 09:53 PM   #7
Afzal
Android Dev
Join Date: Jun 2009
Posts: 1,604

Thanked: 114 Times
Liked: 414 Times




Quote:
Originally Posted by Chad View Post
This is great guys! What's the next step, how can I help?

The Chat plugin used is https://blueimp.net/ajax/ which you could pick apart to see how the admin functionality works.
Thanks Chad, I guess that'll help to get some of the other features in later.

Dillon figured out that adding the ajax=true param to the url gets the xml response so showing the messages should be trivial using Dillon's parser.

I'm just trying to save the cookies for successive calls after login right now. Once that's done, we'll be able to list the messages and users and post messages.
__________________
Afzal Najam - Honours Computer Science grad

anonanon987 likes this.
Old 01-29-2013 at 05:07 PM   #8
anonanon987
Power Abuser
Join Date: Apr 2011
Posts: 3,170

Thanked: 246 Times
Liked: 459 Times




I'm following this thread a little bit too closely. I cannot wait to see the end product. Could possibly help with the testing if need be. Keep it going !
Old 02-04-2013 at 08:21 PM   #9
Afzal
Android Dev
Join Date: Jun 2009
Posts: 1,604

Thanked: 114 Times
Liked: 414 Times




I have to make something till the 12th. The only thing that's left before we can view messages in the app is parsing the XML.

Anyone wanna help? I know Dillon's code can be reused a lot for this part. You can already retrieve messages in XML format and the code for loading the list is commented in MessagesActivity.

You will probably need to write:

- an XML parser, maybe derived from Dillon's code
- Use that parser in GetMessagesRestMethod .parseResponseBody() to make a Messages object
- Modify the Messages constructor to take XML and create Message objects from it and modify Message accordingly

Once you've done this, I'll do the rest (updateContentProvide r and the MessagesCursorAdapter )

And then we'll have a list of Messages, no it won't update automatically yet.
__________________
Afzal Najam - Honours Computer Science grad

Last edited by Afzal : 02-07-2013 at 10:35 AM.
Old 02-06-2013 at 08:21 PM   #10
qwerty91
Elite Member
Join Date: May 2009
Posts: 573

Thanked: 90 Times
Liked: 173 Times




Hey guys!
Code looks great! I am developing the android app for forum functionality of macinsiders. Do you mind if I use some of your code? Specifically Login and some http request stuff.

If it makes a difference Ill be eventually making the app open source.
__________________
Biomedical and Electrical Engineering IV
Old 02-06-2013 at 08:23 PM   #11
Ownaginatios
Trolling ain't easy
Join Date: Jul 2008
Posts: 3,190

Thanked: 499 Times
Liked: 1,642 Times




Quote:
Originally Posted by qwerty91 View Post
Hey guys!
Code looks great! I am developing the android app for forum functionality of macinsiders. Do you mind if I use some of your code? Specifically Login and some http request stuff.

If it makes a difference Ill be eventually making the app open source.
Go for it. Might as well maybe even merge the projects at some point.
__________________
Dillon Dixon
Alumni
Software Engineering and Embedded Systems
Old 02-06-2013 at 09:10 PM   #12
qwerty91
Elite Member
Join Date: May 2009
Posts: 573

Thanked: 90 Times
Liked: 173 Times




Quote:
Originally Posted by Ownaginatios View Post
Go for it. Might as well maybe even merge the projects at some point.
Sweet and yup makes sense eventually
__________________
Biomedical and Electrical Engineering IV
Old 02-07-2013 at 10:32 AM   #13
Afzal
Android Dev
Join Date: Jun 2009
Posts: 1,604

Thanked: 114 Times
Liked: 414 Times




Quote:
Originally Posted by qwerty91 View Post
Hey guys!
Code looks great! I am developing the android app for forum functionality of macinsiders. Do you mind if I use some of your code? Specifically Login and some http request stuff.

If it makes a difference Ill be eventually making the app open source.
Go ahead, the license is mentioned so that you don't have to ask for permission.

A short version of the Apache v2 license: http://www.tldrlegal.com/license/apa....0-(apache-2.0)
__________________
Afzal Najam - Honours Computer Science grad
Old 02-10-2013 at 02:54 AM   #14
Afzal
Android Dev
Join Date: Jun 2009
Posts: 1,604

Thanked: 114 Times
Liked: 414 Times




Well, it lists messages now with all the crude details.



Obviously, design to be cleaned up later. Can't be bothered with that stuff until posting messages is done.
__________________
Afzal Najam - Honours Computer Science grad

Old 02-10-2013 at 08:25 PM   #15
Afzal
Android Dev
Join Date: Jun 2009
Posts: 1,604

Thanked: 114 Times
Liked: 414 Times




Any multimedia students wanna take a shot at some UI designs for this?
__________________
Afzal Najam - Honours Computer Science grad



Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



McMaster University News and Information, Student-run Community, with topics ranging from Student Life, Advice, News, Events, and General Help.
Notice: The views and opinions expressed in this page are strictly those of the student(s) who authored the content. The contents of this page have not been reviewed or approved by McMaster University or the MSU (McMaster Students Union). Being a student-run community, all articles and discussion posts on MacInsiders are unofficial and it is therefore always recommended that you visit the official McMaster website for the most accurate up-to-date information.

Copyright © MacInsiders.com All Rights Reserved. No content can be re-used or re-published without permission. MacInsiders is a service of Fullerton Media Inc. | Created by Chad
Originally Powered by vBulletin®, Copyright © 2019 MH Sub I, LLC dba vBulletin. All rights reserved. | Privacy | Terms