0

I want to develop an app whereby once the user installs the app,an icon is set on the home screen.Thereafter if the user clicks on the icon,a small popup window displays and floats on the left of the home screen.One can then interact with the app from the popup or can click on a button on the popup and be redirected to the application. See the photos below. enter image description hereenter image description here

How do i achieve this?

Help will be highly appreciated.

mungaih pk
  • 1,809
  • 8
  • 31
  • 57

1 Answers1

1

What you'r showing can be achived by using the SYSTEM_ALERT_WINDOW permission. Take a look at a chathead tutorial to get started!

Sebastian
  • 2,698
  • 2
  • 17
  • 26
  • almost similar to what i aim to achieve,but i want mine to be only on the home screen and should appear when the user taps on the app icon. – mungaih pk Apr 21 '14 at 12:28
  • well, that should be easy to achieve by starting the activity, launching the chathead-service and then just call finish() in activity. That way, the chathead-overlay will be visible but not the activity-UI – Sebastian Apr 21 '14 at 12:49
  • if i do that,what about when the user needs to access the app from the drawer icon?Won't he be redirected to the chathead interface? – mungaih pk Apr 21 '14 at 13:18
  • You mean, when the user presses the button on the chathead popup? Have one activity, activity1, where you only start the chathead-service and then finish(), and have another activity,activity2, where you open the main app. Set activity1 to start when the user presses the app-icon. Set activity2 to start when the user presses the chathead-popup button – Sebastian Apr 21 '14 at 13:48
  • thanks for your response.At least now i have an idea of where to start.If i may ask,is there a way one can restrict visibility of a chathead to only the homescreen? – mungaih pk Apr 21 '14 at 14:14
  • Hmm.. that's harder I think. You need to somehow determine what activity is active. A quick search gave me this page: http://stackoverflow.com/questions/2166961/determining-the-current-foreground-application-from-a-background-task-or-service/ That could be something to check out! – Sebastian Apr 21 '14 at 15:21