Groups
Groups
Sign in
Groups
Groups
日本Androidの会
Conversations
About
Send feedback
Help
スクリーンロックの実装方法
811 views
Skip to first unread message
Takuya Endo
unread,
Aug 9, 2013, 12:07:09 AM
8/9/13
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to android-g...@googlegroups.com
こんにちわ、遠藤と申します。
今、自作アプリのスクリーンロック機能を実装したいと思っています。
具体的には、LINEのようにアプリを起動したときに現れる4ケタの暗証番号をもちいた認証画面を作りたいと考えています。
KeyguradMangerは非推奨のようですし、色々見て回ったのですが、いまいち要領を得なかったので、質問させていただきました。
スクリーンロックの実装方法をご存じの方がいましたら、ご教授頂きたいです!
よろしくお願い致します!
Takuya Endo
unread,
Aug 9, 2013, 1:14:42 AM
8/9/13
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to android-g...@googlegroups.com
あんざいゆき氏の
http://y-anz-m.blogspot.jp/2011/08/androidflagdismisskeyguard.html
サイトも覗いたのですが、どうも私がやりたいこととは違うようでした。
これはヒントになるんじゃない??というサイトがありましたら是非教えていただきたいです!
Kamei_Hidetoshi
unread,
Aug 9, 2013, 1:32:28 AM
8/9/13
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to android-g...@googlegroups.com
はじめまして 亀井と申します。
私も現在ロックスクリーンを作りたく試行錯誤をしています。
参考になればと思い不完全な情報ですが投稿させていただきます。
homeボタンで解除してよいのかどうかによって難易度は大きく変わりますが、
もしhomeボタンで解除できてよいのであれば、
単純にブロードキャストからスクリーンon とoffを検出して
activityを起動させて、ロック解除、自分のロック画面表示すればいいみたいです。
参考URL(この記事書いてものではありません)
http://u1aryz.blogspot.jp/2011/05/blog-post.html
もしhomeボタンでロック解除できないようにするには
3つ方法があるみたいです。
1点目:homeボタンはホしれません。ホームアプリを呼ぶので、ロックアプリにロックスクリーンを登録させて
homeを押してもロック画面画面をよぶようにする
たぶん、ゴーロッカーはこれで実装してるかと勝手に思っています。
2点目:windowに直接描画して、下のレイヤーのタッチ判定を殺すのと見えないようにして、
擬似的にロックしてるようにみせる。この場合homeボタンは有効でちゃんと動作はしていますが
windowにロックスクリーン画面が描写されているので見えず、実質操作できなくする
参考URL(この記事書いてものではありません)
http://azrael-android.blogspot.jp/2011/03/blog-post.html
3点目:homeボタンを検出し、そのときに自分のアクティビティを表示するようにする。
この方法は自分もチャレンジ中で詳細はわかりません。
2013年8月9日 14:14 Takuya Endo <
endoo...@gmail.com
>:
> あんざいゆき氏の
http://y-anz-m.blogspot.jp/2011/08/androidflagdismisskeyguard.html
> サイトも覗いたのですが、どうも私がやりたいこととは違うようでした。
>
> これはヒントになるんじゃない??というサイトがありましたら是非教えていただきたいです!
>
> --
> このメールは Google グループのグループ「日本Androidの会」の登録者に送られています。
> このグループから退会し、メールの受信を停止するには、
android-group-j...@googlegroups.com
> にメールを送信します。
> このグループに投稿するには、
android-g...@googlegroups.com
にメールを送信してください。
>
http://groups.google.com/group/android-group-japan
からこのグループにアクセスしてください。
> その他のオプションについては、
https://groups.google.com/groups/opt_out
にアクセスしてください。
kacodama
unread,
Aug 9, 2013, 1:58:50 AM
8/9/13
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to android-g...@googlegroups.com
横からですが1点だけ。
3点目:homeボタンを検出し、そのときに自分のアクティビティを表示するようにする。
この方法は自分もチャレンジ中で詳細はわかりません。
Homeボタン押下の検出(Broadcastのreceive)にはシステム署名が必要となります。
Takuya Endo
unread,
Aug 11, 2013, 11:26:07 PM
8/11/13
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to android-g...@googlegroups.com
Kamei Hidetoshi様
kacodama様
返事が遅れてしまい申し訳ありませんでした。貴重なアドバイスありがとうございます!
今、私なりに自作でパスコードを設定するレイアウトを作り、パスコードロックをオンにすると次回からアプリ起動時に認証画面を呼び出すように
実装していくことにしてみました!
引き続き、スクリーンロックについての情報提供をお願い致します!
Takuya Endo
unread,
Feb 20, 2015, 5:35:18 AM
2/20/15
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to android-g...@googlegroups.com
質問から随分と時間が経ちましたが再び実装する機会があり私なりに作ってみました。
よかったら見てみてください!
http://u-nation.hatenablog.com/entry/2015/02/15/202125
Reply all
Reply to author
Forward
0 new messages