New magnetic pen developed for smartphones