Best Practices for Hybrid Mobile Applications

Need recommendations for security best practices for the JS/HTML/CSS code in hybrid mobile applications.

The javascript code in a hybrid mobile application built on a platform like Cordova, Ionic, IBM Worklight etc. contains the client side logic as well as protections like encryption that are responsible for the security of the HTTP request and response parameters.

I have researched enough to have failed to find an available plugin/tool for encryption/obfuscation/minification of the sensitive files.

Security guys. Please recommend…

Best practices: keyboard dismissal and button display in mobile apps

We have both iOS and Android apps with forms in multiple places, and are looking for an appropriate UX pattern for continuing when the form is complete.

Example: On the login screen, the user must type both a username and password, and then trigger the login action.

1) Should the login button “float” above the keyboard? Only when the last field is active? 2) Should the keyboard dismiss whenever one taps outside of it? 3) Should the “return” button in the keyboard say “continue” when the first field is active and “login” when the final field is active?

This seems like such a standard use case that the behavior should be defined and standard for both iOS and Android platforms, but I’m struggling with finding it documented anywhere!

What are considered best practices when designing data tables?

I’ll soon be tasked with designing data tables with a ton of data. I’d really appreciate it if you guys could point me in the right direction. I’ll share some of the links I’ve found while researching.

Links:

https://medium.com/mission-log/design-better-data-tables-430a30a00d8c

https://medium.muz.li/complex-tables-356826d11861

https://design-nation.icons8.com/intro-to-data-tables-design-349f55861803

https://uxdesign.cc/design-better-data-tables-4ecc99d23356

https://medium.com/nona-web/data-tables-best-practices-f5edbb917823

Best practices for UI that introduces new users

I’m working on an onboarding UI to help new users get familiar with our platform and I was thinking about some good ways to implement it.

From what I have come across so far, it seems that many interfaces accomplish this in two ways:

  • Having an interactive guided tour that overlays over the platform and helps users understand basic functionality. Users can leave the tour at any point but they are also able to access the tour again in the future.

An example of this is the tour that the new Google maps gives to new users. googlemaps

  • Have an organized documentation system that has walkthroughs with step by step instructions (and even perhaps video tutorials). This documentation system is introduced to new users immediately on the landing page through a widget/notice which can be hidden forever.

An example of this is the Github bootcamp shown to new users. github

Are there any other good ways to introduce new users?

Practices for implementing multiple visual themes/styles

I’m wondering how you would go about implementing multiple, chooseable and configurable visual themes in a project.

In my case I would be trying it in a WPF application, but my question is more general.

I was thinking, every used color will be loaded from a .json or .xaml, grouped by the theme. The user would have the option to choose from two or three predefinied themes. The user also has the option to create a copy of an exisiting theme, and edit the colors.

Are these saved individually? Are they loaded whenever the program start? Will these colors be updating live or just when they get changed? What about image instead of colors? Would I still use a .json/.xaml and just specify the URL? Do I need somekind of parser(?) in my sourcecode to read these files? Are there Nuget packages which are made for this kind of task (I did not find any)?

Best practices for online help

we’re currently developing a fairly complex web portal. To improve the user experience, we want to provide a context-sensitive online help system that can aid the user in understanding certain aspects of the site.
In our case, the site has a variety of widgets that display all kinds of tabular data, graphs, etc. For instance, one such widget may display the VIX and a the help system would offer a brief description of what the VIX is.

Now, I’ve looked around in the internet and found some interesting articles such as the Design Checklists for Online Help, but most of what I found seems fairly outdated. What I’m specifically interested in are design issues such as these:

  • whether (or when) to use popups, divs, or link to external pages
  • how comprehensive should the help entry be? how much is the average user willing to read?
  • what’s a good way to provide access to the help system? cluttering the UI with questionmark-icons is certainly not optimal
  • should the help entry be loaded on demand with AJAX (kinda sucks, you want the info right away) or preload it (causing tons of unnecessary traffic)
  • other dos and don’ts

The answers to some of these questions may seem obvious, but when it comes to usability I’ve made the experience that the intuitive answer isn’t always the best. Secondly, I’m a software developer and as such I tend to look at things from an engineer’s point of view. And I think we all know that this is, more often than not, a pretty poor angle from which to approach the design of a user interface. This is why I would very much like get some feedback from people more experienced in this field.

Golang and Gin framework: best practices to connect to Postgresql

I come from this question.

Project

A very simple project with Gin framework with an endpoint to return a list of users based on their score.

Structure

liveops-tool -- user ---- model ------ user.go ---- service ------ userService.go ---- dao ------ directory.go (interface) ------ userDirectory.go (mock the db) ------ userPostgresDirectory.go -- main.go 

main.go

r.GET("/competition/users", func(c *gin.Context) {     numUsers, err := strconv.Atoi(c.DefaultQuery("numusers", "6"))     minScore, err := strconv.Atoi(c.DefaultQuery("minscore", "0"))     maxScore, err := strconv.Atoi(c.DefaultQuery("maxscore", "2000"))     fmt.Printf("numUsers: %d , minScore: %d , maxScore: %d \n", numUsers, minScore, maxScore)      if err == nil {         var userDirectoryService = userService.NewService(userDirectory.UserPostgrestDirectory{})         var res = userDirectoryService.GenerateUserListByScore(numUsers, minScore, maxScore)         c.JSON(http.StatusOK, gin.H{"users": res})     } else {         c.JSON(http.StatusBadRequest, gin.H{"users": "no valid"})     }  }) 

userService.go

package user  import (     dao "liveops-tool/user/dao"     models "liveops-tool/user/models" )  type UserService struct {     dir dao.Directory }  func NewService(dir dao.Directory) *UserService {     var service = &UserService{         dir: dir,     }     return service }  // GenerateUserListByScore returns a list of users for a tournament func (u UserService) GenerateUserListByScore(numUsers, minScore, maxScore int) []models.User {     return u.dir.SearchUsers(numUsers, minScore, maxScore) } 

userPostgresDirectory.go

package user  import (     "database/sql"     "fmt"     models "liveops-tool/user/models"     "strings"      _ "github.com/lib/pq" )  const (     host     = "localhost"     port     = 5432     user     = "postgres"     password = "XXXX"     dbname   = "XXXX" )  type UserPostgrestDirectory struct { }  func (u UserPostgrestDirectory) getConnection() *sql.DB {     psqlInfo := fmt.Sprintf("host=%s port=%d user=%s "+"password=%s dbname=%s sslmode=disable", host, port, user, password, dbname)     db, err := sql.Open("postgres", psqlInfo)     checkErr(err)      return db }   func (u UserPostgrestDirectory) SearchUsers(numUsers, minScore, maxScore int) []models.User {     db := u.getConnection()     defer db.Close()     err := db.Ping()     checkErr(err)      fmt.Println("Successfully connected!")      rows, err := db.Query("SELECT * FROM users WHERE total_score >= $  1 AND total_score <= $  2 LIMIT $  3", minScore, maxScore, numUsers)     if err != nil {         panic(err)     }      var users = []models.User{}     for rows.Next() {         var id int         var name string         var country string         var total_score int         err = rows.Scan(&name, &id, &country, &total_score)         checkErr(err)         fmt.Println("id | name | country | total_score ")         fmt.Printf("%3v | %8v | %6v | %6v\n", id, name, country, total_score)         user := models.User{             ID:         id,             Name:       strings.TrimSpace(name),             Country:    strings.TrimSpace(country),             TotalScore: total_score,         }          users = append(users, user)     }     return users }  func checkErr(err error) {     if err != nil {         panic(err)     } } 

Questions

  • Is it possible to retrieve the connection directly open or apply some singleton pattern to avoid creating a connection every time that the method SearchUsers is called? I even tried to pass the connection on the UserPostgrestDirectory constructor from main.go but I always get the error “database is closed”.

Any other feedback about the code is well received.

Golang and Gin framework: best practices to connect to Postgresql

I come from this question.

Project

A very simple project with Gin framework with an endpoint to return a list of users based on their score.

Structure

liveops-tool -- user ---- model ------ user.go ---- service ------ userService.go ---- dao ------ directory.go (interface) ------ userDirectory.go (mock the db) ------ userPostgresDirectory.go -- main.go 

main.go

r.GET("/competition/users", func(c *gin.Context) {     numUsers, err := strconv.Atoi(c.DefaultQuery("numusers", "6"))     minScore, err := strconv.Atoi(c.DefaultQuery("minscore", "0"))     maxScore, err := strconv.Atoi(c.DefaultQuery("maxscore", "2000"))     fmt.Printf("numUsers: %d , minScore: %d , maxScore: %d \n", numUsers, minScore, maxScore)      if err == nil {         var userDirectoryService = userService.NewService(userDirectory.UserPostgrestDirectory{})         var res = userDirectoryService.GenerateUserListByScore(numUsers, minScore, maxScore)         c.JSON(http.StatusOK, gin.H{"users": res})     } else {         c.JSON(http.StatusBadRequest, gin.H{"users": "no valid"})     }  }) 

userService.go

package user  import (     dao "liveops-tool/user/dao"     models "liveops-tool/user/models" )  type UserService struct {     dir dao.Directory }  func NewService(dir dao.Directory) *UserService {     var service = &UserService{         dir: dir,     }     return service }  // GenerateUserListByScore returns a list of users for a tournament func (u UserService) GenerateUserListByScore(numUsers, minScore, maxScore int) []models.User {     return u.dir.SearchUsers(numUsers, minScore, maxScore) } 

userPostgresDirectory.go

package user  import (     "database/sql"     "fmt"     models "liveops-tool/user/models"     "strings"      _ "github.com/lib/pq" )  const (     host     = "localhost"     port     = 5432     user     = "postgres"     password = "XXXX"     dbname   = "XXXX" )  type UserPostgrestDirectory struct { }  func (u UserPostgrestDirectory) getConnection() *sql.DB {     psqlInfo := fmt.Sprintf("host=%s port=%d user=%s "+"password=%s dbname=%s sslmode=disable", host, port, user, password, dbname)     db, err := sql.Open("postgres", psqlInfo)     checkErr(err)      return db }   func (u UserPostgrestDirectory) SearchUsers(numUsers, minScore, maxScore int) []models.User {     db := u.getConnection()     defer db.Close()     err := db.Ping()     checkErr(err)      fmt.Println("Successfully connected!")      rows, err := db.Query("SELECT * FROM users WHERE total_score >= $  1 AND total_score <= $  2 LIMIT $  3", minScore, maxScore, numUsers)     if err != nil {         panic(err)     }      var users = []models.User{}     for rows.Next() {         var id int         var name string         var country string         var total_score int         err = rows.Scan(&name, &id, &country, &total_score)         checkErr(err)         fmt.Println("id | name | country | total_score ")         fmt.Printf("%3v | %8v | %6v | %6v\n", id, name, country, total_score)         user := models.User{             ID:         id,             Name:       strings.TrimSpace(name),             Country:    strings.TrimSpace(country),             TotalScore: total_score,         }          users = append(users, user)     }     return users }  func checkErr(err error) {     if err != nil {         panic(err)     } } 

Questions

  • Is it possible to retrieve the connection directly open or apply some singleton pattern to avoid creating a connection every time that the method SearchUsers is called? I even tried to pass the connection on the UserPostgrestDirectory constructor from main.go but I always get the error “database is closed”.

Any other feedback about the code is well received.

Golang and Gin framework: best practices to connect to Postgresql

I come from this question.

Project

A very simple project with Gin framework with an endpoint to return a list of users based on their score.

Structure

liveops-tool -- user ---- model ------ user.go ---- service ------ userService.go ---- dao ------ directory.go (interface) ------ userDirectory.go (mock the db) ------ userPostgresDirectory.go -- main.go 

main.go

r.GET("/competition/users", func(c *gin.Context) {     numUsers, err := strconv.Atoi(c.DefaultQuery("numusers", "6"))     minScore, err := strconv.Atoi(c.DefaultQuery("minscore", "0"))     maxScore, err := strconv.Atoi(c.DefaultQuery("maxscore", "2000"))     fmt.Printf("numUsers: %d , minScore: %d , maxScore: %d \n", numUsers, minScore, maxScore)      if err == nil {         var userDirectoryService = userService.NewService(userDirectory.UserPostgrestDirectory{})         var res = userDirectoryService.GenerateUserListByScore(numUsers, minScore, maxScore)         c.JSON(http.StatusOK, gin.H{"users": res})     } else {         c.JSON(http.StatusBadRequest, gin.H{"users": "no valid"})     }  }) 

userService.go

package user  import (     dao "liveops-tool/user/dao"     models "liveops-tool/user/models" )  type UserService struct {     dir dao.Directory }  func NewService(dir dao.Directory) *UserService {     var service = &UserService{         dir: dir,     }     return service }  // GenerateUserListByScore returns a list of users for a tournament func (u UserService) GenerateUserListByScore(numUsers, minScore, maxScore int) []models.User {     return u.dir.SearchUsers(numUsers, minScore, maxScore) } 

userPostgresDirectory.go

package user  import (     "database/sql"     "fmt"     models "liveops-tool/user/models"     "strings"      _ "github.com/lib/pq" )  const (     host     = "localhost"     port     = 5432     user     = "postgres"     password = "XXXX"     dbname   = "XXXX" )  type UserPostgrestDirectory struct { }  func (u UserPostgrestDirectory) getConnection() *sql.DB {     psqlInfo := fmt.Sprintf("host=%s port=%d user=%s "+"password=%s dbname=%s sslmode=disable", host, port, user, password, dbname)     db, err := sql.Open("postgres", psqlInfo)     checkErr(err)      return db }   func (u UserPostgrestDirectory) SearchUsers(numUsers, minScore, maxScore int) []models.User {     db := u.getConnection()     defer db.Close()     err := db.Ping()     checkErr(err)      fmt.Println("Successfully connected!")      rows, err := db.Query("SELECT * FROM users WHERE total_score >= $  1 AND total_score <= $  2 LIMIT $  3", minScore, maxScore, numUsers)     if err != nil {         panic(err)     }      var users = []models.User{}     for rows.Next() {         var id int         var name string         var country string         var total_score int         err = rows.Scan(&name, &id, &country, &total_score)         checkErr(err)         fmt.Println("id | name | country | total_score ")         fmt.Printf("%3v | %8v | %6v | %6v\n", id, name, country, total_score)         user := models.User{             ID:         id,             Name:       strings.TrimSpace(name),             Country:    strings.TrimSpace(country),             TotalScore: total_score,         }          users = append(users, user)     }     return users }  func checkErr(err error) {     if err != nil {         panic(err)     } } 

Questions

  • Is it possible to retrieve the connection directly open or apply some singleton pattern to avoid creating a connection every time that the method SearchUsers is called? I even tried to pass the connection on the UserPostgrestDirectory constructor from main.go but I always get the error “database is closed”.

Any other feedback about the code is well received.