2015년 1월 1일 목요일

Supersmart "notice board" in my app?

I am working on an app which needs a "notice board" function, i.e. a possibility to post and read notices. Users should not have to log in. I thought I solved this in a supersmart way(!)  but I ran in to some difficulties. Here is how I solved it:

  1. I created a form in Google Drive with only two text questions: "Name" and "Message".
  2. I set up a spreadsheet in Google Drive collecting the answers from the form above, and published it on the web.
  3. In my app I used WebViewer to call the form (1) by entering the URL to the live form. This allows users can post a message.
  4. I also used WebViewer to call the spreadsheet (2) by entering the URL to the spreadsheet. This is how users can view old messag
Including this (3 and 4) in the app only requires a couple of WebViewer blocks - and it works! So far so good but...

  • I don't know how to sort messages so the last message shows up on top in the spreadsheet when I call it using WebViewer. I can sort the messages in in Google Drive but whenever I post a new message this is added at the bottom of the list...
  • I can't seem to be able to scroll up/down the speadsheet to see a longer list of messages using WebViewer. All I can do is zoom in and out...
Any clues on how to solve these things would be highly appreciated! 

PS. I have considered using a "chat function" like PubNub but the app will potentially have more the max 20 users allowed in the "freeware mode".



1. instead of using a Google spreadsheet, you could use a fusiontable instead, because there it is easy to sort the rows
2. did you set the web viewer height to fill parent?



Thanks for your suggestions, Taifun! However, using Google fusiontables for "notice board" will require users to login in order to post messages, right? I wish to avoid login but if it is the only way to sort my messages I may have to reconsider it...



I just tested another way to sort my messages which turned out to work great:

I created an additional sheet in the spreadsheet containing the answers from my form and used the function SORT to sort all messages in the original sheet in descending order (making the data range equal to all rows in the sheet, because new messages will increase the number of rows). I then published this second sheet on the web and pasted the link into WebViewer (replacing the link to the original sheet). 

The only problem left to solve now is how to make the speadsheet scrollable in my app... it does not seem related to the "fill parent" setting which Taifun suspected (other Google spreadsheets are scrollable in WebViewer when I test). Could it be something related to the fact that this is a special type of spreadsheet filled with answers from a form?  Any ideas out there?



Here is an attempt to clarify my Webviewer scroll problem. Below are links to two published Google spreadsheets: 



However, only the first spreadsheet is scrollable when viewed in Webviewer. Any ideas why?



However, using Google fusiontables for "notice board" will require users to login in order to post messages, right?
wrong.. you can use a service account, see here
as you can see in the attached example app, you can scroll in the 2nd spreadsheet...




Thanks again, Taifun! I will surely explore ways to use Fusiontables without login!

I installed the example you made but it is not scrollable on my phone (HTC Desire HD with Android 2.3.5). I trust it must be a problem with my older Android...?



sorry, I don't know
I tested successfully on Nexus 5 running Android 5.0.1
try another device


댓글 없음:

댓글 쓰기