yashsingh1/xdaforums huggingface dataset:
[Android Apps and Games] petete7:
Awesome lib and ideas

Standout is indeed a great library!!

I'm using it since a couple of days and it helped me to solve the challenge of overlaying widgets on top of 3D apps.

The application that I'm developing has a single window that I want to hide and display from the notification. I think that for a single window to have a second notification icon is a bit overkill.

I added an extra action that I called ACTION_TOGGLE and extended onStartCommand to handle it. I use that action in the persistent intent.I send that action in getPersistentNotificationIntent. So far so good.

@Override

public int onStartCommand(Intent intent, int flags, int startId) {

int result = super.onStartCommand(intent, flags, startId);

if (intent != null) {

String action = intent.getAction();

int id = intent.getIntExtra("id", DEFAULT_ID);

if (ACTION_TOGGLE.equals(action)) {

Window window = getWindow(id);

if (window != null) {

if (window.visibility != Window.VISIBILITY_VISIBLE) {

show(id);

} else {

hide(id);

}

}

}

}

return result;

}

The problem is that, if you enable hiding, there is no way to disable the creation of the notification entry for the hidden window. the method hide() is final! I had no other choice than to modify your library. I added the following:

if (notification != null){

// display the notification

notification.flags = notification.flags

| Notification.FLAG_NO_CLEAR

| Notification.FLAG_AUTO_CANCEL;

mNotificationManager.notify(getClass().hashCode() + id,

notification);

}

This way I can remove the notification by returning null when extending getHiddenNotification(id).

Thanks anyway!!!

One last thing. Do you have any plans on mavenizing the project?

Cheers!
[Android Apps and Games] Mohammad_Adib:
Mark, can I lose the notification if I return START_STICKY? seems to working.
[Android Apps and Games] pingpongboss:
Wow, I must have missed the null check in hide(). You can see from the javadoc of getHiddenNotification() that returning null is allowed. I meant for hide() to show the notification only if something is returned.

I have no experience with maven. Someone did contribute to allow building from ant https://github.com/pingpongboss/StandOut/commit/db4c6287a6bf315d990872b04f2c5344d32bac79. If anyone wants to submit a pull request for maven support I'll be glad to accept.

I've created a ticket for the notification issue.

https://github.com/pingpongboss/StandOut/issues/14

A note to anyone reading this: Pull requests are always welcomed :) Fork StandOut on Github, make some of your own commits, and submit a pull request so I can merge your changes into StandOut.

I'm assuming that you got rid of startForeground() as well. This will work for a short while, until Android decides that it needs more memory. Once memory is low, the StandOut service will be killed, and all your windows will disappear. When the system has enough memory, the StandOut service will be started again and your windows will reappear. My guess is that since your Sidebar app is invisible most of the time, you'll mistakenly think that it's always working.

Just a side note: if you have startForeground(), returning START_STICKY or START_NOT_STICKY does not matter, since those flags only apply to behavior after your Service is killed by the system. If you have startForeground(), your Service will never be killed.
[Android Apps and Games] Mohammad_Adib:
Yup, had to keep the notification. Android needs to change this...getting too many complaints about it.
[Android Apps and Games] Mohammad_Adib:
Hey mark, apps like Any.DO have notifications with no icon on the top bar. How do I make StandOut have this type of notification? I tried notification.setPriority(Notification.LOW_PRIORITY); but Eclipse said that method doesn't even exist...Any suggestions?
[Android Apps and Games] pingpongboss:
Setting notification priorities are available in JellyBean+. Make sure your project is targetting 4.1 or above.

Plus, I'm pretty sure they're just using a transparent icon.
[Android Apps and Games] icarmel:
Thanks for replying.

I'm getting the same error even when the VideoView is removed.

I'm trying to inflate the SimpleWindow layout in the Presentation.onCreate (where the layout is very simple and contains only TextView)

LayoutInflater inflater = (LayoutInflater) LayoutInflater.from(SimpleWindow.this);

View v = inflater.inflate(com.floatingvideo.example.R.layout.simple, mFrameLayout, true);

setContentView(v);

Is there a way to send a StandOutWindow view to an external/secondary display?

any idea?

Thanks.
[Android Apps and Games] wutk3ksHD:
How can i handle pressing Volumekeys UP and DOWN without changing the system volume? onKeyEvent is the way to go, but it does always change the volume.
[Android Apps and Games] Mohammad_Adib:
Dude Mark, why is Sidebar a "Secondary server" ??

It disappears off the list after a few seconds too. ROM Toolbox can't detect it after that.
[Android Apps and Games] pingpongboss:
Are you returning true from onKeyEvent()?

Secondary server seems to be a term that encompasses all important services. Here's an explanation from http://xdaforums.com/showthread.php?t=897823
[Android Apps and Games] wutk3ksHD:
Yes, i do.
[Android Apps and Games] pingpongboss:
Perhaps you're not capturing both all the actions for each keycode? http://stackoverflow.com/questions/2874743/android-volume-buttons-used-in-my-application
[Android Apps and Games] Mohammad_Adib:
Is there no other way to keep standout running other than that notification? -.-
[Android Apps and Games] pingpongboss:
If there was, other app developers would have found it already. You can see that all other apps which use some sort of overlay, always have a notification going. You can make the notification clever and non-intrusive, but you can't remove it.

If you're the first to figure out how to trick Android and remove the notification, let me know so I can put it in StandOut.
[Android Apps and Games] Mohammad_Adib:
You work at Google so tell the developers there to get rid of needing a notification for overlay apps.. like seriously :(
[Android Apps and Games] cb56:
Please, try to set notification icon equal to an empy string, for me it works; try this App, it start a foreground service with notification icon set as an empty string...and runs forever.

Let me know...

cb56
[Android Apps and Games] Mohammad_Adib:
Yeah that app stays alive. I'm not sure if the pop-up comes from a service or an activity but regardless it does work without a notification.
[Android Apps and Games] cb56:
The pop-up and the sound comes from a service.

cb56
[Android Apps and Games] Garrett1976:
Performance Issues

1) Has anyone else experienced performance issues with apps using StandOut? The floating window on my app becomes unresponsive eventually...won't move, resize or respond to button clicks. Other times it responds to the clicks but the view doesn't refresh. It's entirely possible that it's something in my code, I just wanted to see if others have seen this. My app is loading images and media from the SD card, as well as from the Internet, but the freezing issue doesn't seem to be related to the Internet functionality as that only happens when it is first launched.

2) Are there any useful tools within Eclipse to help me diagnose performance problems, memory utilization/leaks, etc? There are no actual errors generated, it just becomes unresponsive, so debugging isn't really any help.

Thanks
[Android Apps and Games] Mohammad_Adib:
Yeah! I've experienced that with Floating Stickies. It happened only when I tapped a window to move it to the top of the other ones. That's why Floating Stickies doesn't have that feature.
[Android Apps and Games] wutk3ksHD:
Performance issues might have to do with updateViewLayou(). I had the the same problems with floating notes and experienced freezes when i used Editor or updateViewLayout(). Using StandOutLayoutParams.Fill_parent / wrap_content is the cause, i Guess.
[Android Apps and Games] Garrett1976:
Performance Issues

Thanks guys!! Those two changes seem to have fixed the freezing issue. :)
[Android Apps and Games] wutk3ksHD:
So what did you change actually :)?
[Android Apps and Games] pingpongboss:
I've talked to the right people at Google, and it's true that you've found a hack/workaround. :good: But the framework team is already aware of this, and they plan to fix it. The decision that all long-living background services need to have a visible notification will not be changed. The restriction is quite annoying for you guys, who are trying to make floating apps, but it is the right decision for the vast majority of other cases. If the system is slowing down, if the user's battery starts dying, the user needs to know which background services are running that might be misbehaving.

You'll all have to continue to be make creative notifications!
[Android Apps and Games] cb56:
Hi,

I thank you for reply.

I do not think they do, there are many applications that use services in foreground ... or use this trick, or there must be another way to not display the icon ...

I think that if the framework team will fix it, probably we will end up full of notification icons! :angel:

cb56
[Android Apps and Games] pingpongboss:
I talked to the engineers that work on the framework and yes, they do think it's a bug and yes, they do plan to fix it. You are free to think what you want though :)
[Android Apps and Games] Mohammad_Adib:
Lamesauce. Dafuq google -.-? Man...they need to have Standout as a separate API that comes with the SDK. Uuuggggghhhhhh -.- sgggsfsfgzsggssgg
[Android Apps and Games] pingpongboss:
Hahahah I am honored that you think this way :D keep up the good work :good:
[Android Apps and Games] joshua764:
me where I can learn how to make an app? I'm new to this!

Enviado desde mi MB855 usando Tapatalk 2
[Android Apps and Games] wutk3ksHD:
Tiny Apps

It is a package of 5 floating apps.

Tiny Notes

save notes to your storage

open saved notes

share text right out of Tiny Notes

copy and paste supported

Tiny Recorder

start a recording and save it to your storage

delete and share recordings

Tiny Paint

trace something on your screen

open and save paintings

select one of 36 colors

undo possibility

clear canvas

Tiny Musicplayer

lists all musicfiles on your device

displays artist, title and albumcover

play/pause, next, previous

select random sequence

enable repeatmode

Tiny Calculator

calculate simple and complex arithmetical problems

switch between basic and advanced numberpad

copy the result to your clipboard

Tiny Apps includes a widget for your homescreen. You can open a Tiny App with less clicks.

App thread

​
[Android Apps and Games] Mohammad_Adib:
Hey Mark, off topic but my friend Frank Lu had heard about you at UCB :D World is a small place.
[Android Apps and Games] pingpongboss:
Put you on the front page. Good work :)

I would start here http://developer.android.com/training/index.html

Haha small world indeed. Especially the CS community at Berkeley.
[Android Apps and Games] Mohammad_Adib:
I bet Sony "borrowed" some stuff from you Mark. http://developer.sonymobile.com/knowledge-base/sdks/sony-add-on-sdk/small-app-api/
[Android Apps and Games] punitvthakkar:
Hey Mark, I have created this little app using your library that provides an always accessible Recent Apps button for phones sporting hardware keys. It is my first app, and thanks to you I have been able to bring it to fruition. Thanks for that!!

Here are the screenshots and the app's thread. Do tell me how you like the concept.

APP THREAD: FLOATING RECENT APPS BUTTON

Again, Thanks a lot!! :laugh:
[Android Apps and Games] darko150:
Super!

Send from Cubot a8808 by Tapatalk
[Android Apps and Games] ZivL:
Why do you need to root it?

Hey,

I want to create a clip of a user that is using the smartphone,for user personal usage. I want to create a floating app that is foreground running and not hidden from the user (don't want to take screenshots of his device without the user knowledge). seeing aSnap, I was wondering why do a user needs to root his mobile device?

Thanks,

Z
[Android Apps and Games] wutk3ksHD:
Mohamad Adibs asnap needs root access to take a screenshot. Taking a Screenshot reads the framebuffer of your device and this is for security reasons usualy Not possible. If you have root access (a rooted phone), you can access this framebuffer. If you havent, you cant.
[Android Apps and Games] SagiLo:
Bug ?

I've tried using the API but i've noticed the hide() is calling 'getShowIndent()' causing the whole app to crash

Here is the hide() implementation from 'StandOutWindow.class'

public static void hide(Context context,
Class<? extends StandOutWindow> cls, int id) {
context.startService(getShowIntent(context, cls, id));
}
[Android Apps and Games] pingpongboss:
Nice. This is kind of like iOS's virtual home button, "Assistive Touch". I'll add it to the front page when I get the chance.

Oh, fail. hide() is supposed to call getHideIntent() https://github.com/pingpongboss/StandOut/issues/15
[Android Apps and Games] wutk3ksHD:
Hey Mark.

Tiny Apps, my latest project was posted on the frontpage of XDA-developers.com and androidpolice.

However, i just want to say thanks for this awesome library and to confess my love to StandOut :)
[Android Apps and Games] wutk3ksHD:
Mohamad Adib, you should better check this: https://play.google.com/store/apps/details?id=com.hzsoft.sidebar
[Android Apps and Games] SagiLo:
1. Is there a way the window will not flash when using show() ? (only 1 window exists, i use hide and show , whenever show is triggered the window flashes)

I didnt use any of the 'bring to front' flags.

2. Is there a way to disable notification ? both per window and main app notification.

Thanks !!!
[Android Apps and Games] Mohammad_Adib:
Yeah, it's pretty stupid - I got tons of people to report it, hey Mark tell the big heads at Google Play to get rid of that copied Sidebar lol.

---------- Post added at 07:54 AM ---------- Previous post was at 07:53 AM ----------

Hey Mark,

I noticed on the Gmail app that when I long press an email and move it around the screen,it hovers over the navigation bar and notification bar, why can't StandOut do that and how the H-double-hockeysticks is that even possible!?!?

:eek: :eek: :eek: wut
[Android Apps and Games] pingpongboss:
haha nice work :good:

What do you mean "flash when using show"? Is the window hidden at first? Is it already showing when you do show()?

You'll have to go through official channels. I don't know if there's anything I can do for you lol. But yea that's messed up.

I actually have no idea how that drag and drop stuff is drawn.
[Android Apps and Games] Mohammad_Adib:
Dude, this thing is so intruiging.

You're on the gmail team so you should know people who know what in the world is going on here.

Check it out: it floats over Floating Stickies, but the gmail app doesn't even require the draw over other apps permission. Dafuuuuq o.O!? (Drag only works on tablet dpi)

Mark you should find out about this and make Standout be able to overlay the notification and navigation bar, the possiblities are endless, I would replace the navbar on tablets with a windows taskbar look alike (horizontal sidebar basically). Like holy shheet that would be amazing. DUUUDEE...and notification replcement maybe.
[Android Apps and Games] pingpongboss:
If I had to guess, I'd say that the drag and drop shadow (see drop shadow here http://developer.android.com/guide/topics/ui/drag-drop.html) are special case items. Though I'd say from scanning the doc, maybe you could use it to your advantage? Apparently, if you initiate a drag event, the system provides you a Canvas for you to draw anything in. But then I'd expect the system to start eating up touches and stuff so that you couldn't make use of this to draw normal windows and still interact with the rest of the system.

I certainly don't have time now to look into it :)
[Android Apps and Games] Mohammad_Adib:
Yeah, when you do though, see if you can find a way to draw over the navbar and the notification. That would be so cool if non-root users could replace their navbars and notification bars.
[Android Apps and Games] pingpongboss:
Check out this answer http://stackoverflow.com/a/13653075/450396

You can use TYPE_SYSTEM_OVERLAY to draw over the statusbar (StandOut uses TYPE_SYSTEM_ALERT), but then you'd get no touches/clicks. There's no good way currently.
[Android Apps and Games] Mohammad_Adib:
Wait, so then why didn't you use system overlay for Standout :eek:? Because the system overlay doesn't get touches?

dafuq google!? puts overlay api and ruins it :eek: at the same time.

---------- Post added at 10:18 AM ---------- Previous post was at 10:09 AM ----------

The official "scumbag google" meme
[Android Apps and Games] pingpongboss:
lol they did it to protect the user. You can imagine a malicious app displaying an overlay on top of the statusbar. And if overlays took touches, that app can prevent the user from ever looking at their new statusbar items. That would be bad.

Protip: You should think twice before dissing my employer like that :p
[Android Apps and Games] Mohammad_Adib:
lol it had to be done. Jk bro :p

I might work for Google someday too ;)

My cousin works there at MountainView. You might even know him who knows.
[Android Apps and Games] pingpongboss:
haha no feelings were hurt. what's his name? You can message me privately
[Android Apps and Games] SagiLo:
It is not already shown up ... (if it was, it would have crashed),

I mean, i use hide() to hide the popup, whenever i use show() it flashing twice when showing up (like quickly 'showing, hiding, showing) ...

And do you have any idea why the emulator keep crashes when using 'hide()' ?

The phone works fine but the emulator crashes...

Thanks !
[Android Apps and Games] SagiLo:
Also... :)

My button in my floating window is not shown with 100% opacity...

I really have no idea where i control it's opacity (when it was on activity it was 100%..)

I tried changing the 'widget.xml' background since it's built on, but no change..

Thanks !
[Android Apps and Games] wutk3ksHD:
Android ICS's buttons dont have 100% opacity, do they? If you want buttons with 100% opacity, define your own background in a xml-file.
[Android Apps and Games] SagiLo:
Thank but it is defined background (image) and I used it before in activity with 100% opacity ...
[Android Apps and Games] wutk3ksHD:
you can set a background's opacity like this: myButton.getBackground().setAlpha(255); set a value between 0 and 255. 255 is 100% opacity.
[Android Apps and Games] SagiLo:
Thank but I already tried it,

And it's actually :

myBotton.getBackground().mutate().setAlpha(m_opacity);

It even makes things worse, whenever i use this command the button opacity turns real low...

whenever it is not used, the opacity is almost 100% (current state)..
[Android Apps and Games] wutk3ksHD:
Please post your background source
[Android Apps and Games] SagiLo:
btn_toggle

<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_checked="false" android:drawable="@drawable/btn_toggle_off" />
<item android:state_checked="true" android:drawable="@drawable/btn_toggle_on" />
</selector>

btn_toggle_bg

<item android:id="@+id/myToggle" android:drawable="@drawable/btn_toggle" />

used in style :

<style name="lockToggle">
<item name="android:background">@drawable/btn_toggle_bg</item>
<item name="android:textOn">""</item>
<item name="android:textOff">""</item>
</style>

used in layout:

<ToggleButton android:id="@+id/lockButton"
style="@style/lockToggle"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
[Android Apps and Games] gcrutchr:
Is it possible to use this framework to have the Adobe viewer in a window? I have a serious need for having 2 Adobe viewers (windowed) running on my tablet.

Explanation - I am an English teacher and we use ebooks. The problem is the students want the text in one window and questions in another window - side-by-side. Scrolling back and forth in a single window is a real pain for the students.
[Android Apps and Games] pingpongboss:
I don't know what's going on. I've never had an issue where StandOut was making stuff transparent. Did you create your own subclass of StandOutWindow? Or did you modify one of the example subclasses?

Unfortunately you cannot take an existing app, and make it run in a window without modification. The creator of the app will have to edit their project to support StandOut.
[Android Apps and Games] SagiLo:
I used it only as library over my app

But today I took the untouched example and only changed the background color in the XML (widget.xml) from 'aa000000' to '00000000' and the button is not 100% opacity ...

Take a look at the attache (cropped) screenshot, you can see the button color is not blocked and you can see the text behind it ...
[Android Apps and Games] sameerg:
ImageView onClickListener

Hi, Thanks a lot for StandOut :)

Can you pls help me out, the problem is that I have an imageView which have a setOnClickListener and it works fine. But after setting the OnClickListener , I am not able to drag the ImageView icon.

Can you pls suggest me the solution. Thanks a lot. :)
[Android Apps and Games] wutk3ksHD:
Instead of using an onclicklistener, set an onTouchListener! try to return true or false.
[Android Apps and Games] sameerg:
Thanks for your reply. I tried using onTouchListener but it also causes when i move the image :(.

I am sorry, I am new to android development pls. Thanks :)
[Android Apps and Games] Mohammad_Adib:
LOL. This took like 2 hours tops

RoundR: http://xdaforums.com/showthread.php?t=2234079

Too bad it's not April fools...this app is probably the dumbest thing I've ever thought of but I can't live without it now....screen feels so rectangle-y without rounded corners.

Oh and uh..here: https://github.com/MohammadAdib/RoundR mentioned you like everywhere I could.
[Android Apps and Games] wutk3ksHD:
fu**ing awesome!
[Android Apps and Games] hospos:
Thanks a million dude, I have like 4 new most used apps because of this. Great work and thanks for releasing to the public!
[Android Apps and Games] Mohammad_Adib:
Yoooo Mark

@Override
public Notification getPersistentNotification(int id) {
int icon = getAppIcon();
long when = System.currentTimeMillis();
Context c = getApplicationContext();
String contentTitle = getPersistentNotificationTitle(id);
String contentText = getPersistentNotificationMessage(id);

Intent notificationIntent = getPersistentNotificationIntent(id);

PendingIntent contentIntent = PendingIntent.getService(this, 0, notificationIntent, PendingIntent.FLAG_UPDATE_CURRENT);

[COLOR="Red"]// 4.1+
[B]final int apiLevel = Build.VERSION.SDK_INT;
if (apiLevel >= 16) {
Notification.Builder mBuilder = new Notification.Builder(this).setSmallIcon(getAppIcon()).setContentTitle(contentTitle).setContentText(contentText).setPriority([COLOR="Blue"]Notification.PRIORITY_MIN[/COLOR]).setContentIntent(contentIntent);
return mBuilder.build();
}[/B][/COLOR]

String tickerText = String.format("%s: %s", contentTitle, contentText);

Notification notification = new Notification(icon, tickerText, when);
notification.setLatestEventInfo(c, contentTitle, contentText, contentIntent);

return notification;
}
[Android Apps and Games] pingpongboss:
Nice! Simple concept, and looks like it's getting really popular. Thanks for the mentions. My friend told me he was just browsing around for new apps, and saw "Mark Wei" in your RoundR thread all of a sudden haha.

I'm glad this is kicking off many new floating apps! The developers here are building some very high quality apps :)

Is this code supposed to hide the icon from the status bar?
[Android Apps and Games] Mohammad_Adib:
Yeeeaaaaaaahhhhh :D download sidebar fstickies or roundr to see

If you don't put setIcon then there is no notif whatsoever and service doesnt die.
[Android Apps and Games] pingpongboss:
haha yes minimum priority hides the icon from the status bar, but still shows it in the notification shade pull-down.

Unfortunately setIcon() will be required in the future. Don't count on it!
[Android Apps and Games] Mohammad_Adib:
Darnit Google -.-