yashsingh1/xdaforums huggingface dataset:
[Android Apps and Games] Mohammad_Adib:
Yoooo Mark

Sesky Notification:

Layout notification.xml:

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:tools="http://schemas.android.com/tools"
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/rl"
android:layout_width="match_parent"
android:layout_height="match_parent" >

<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_marginLeft="12dp"
android:layout_marginTop="8dp"
android:text="RoundR"
android:textAppearance="?android:attr/textAppearanceMedium" />

<TextView
android:id="@+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="@+id/textView1"
android:layout_marginLeft="12dp"
android:text="Tap to configure" />

</RelativeLayout>

Android Jellybean+ Custom Notification :cool:

// 4.1+ Low priority notification
final int apiLevel = Build.VERSION.SDK_INT;
if (apiLevel >= 16) {
Notification.Builder mBuilder = new Notification.Builder(this).setContent(new RemoteViews(getPackageName(), R.layout.notification)).setSmallIcon(getAppIcon()).setContentTitle(contentTitle).setContentText(contentText).setPriority(Notification.PRIORITY_MIN).setContentIntent(contentIntent);
return mBuilder.build();
}

GG
[Android Apps and Games] asafkoski:
Hiding an underline Activity

Hey man,

I've just went through most of the thread, and I think this library is exciting.

I've noticed that somewhere in the beginning of the thread you were talking about a hack of hiding the underline activity in order to show MapView within a stand out window.

Is there a reason you haven't put out the code on the GitHub at the end?

I would realy like to see this example, hack or not.

I want to do a similar thing with the new Youtube API, which requires to be embedded within an Activity.

Would appreciate any help

Thanks,

Asaf

asafkoski@gmail.com
[Android Apps and Games] pingpongboss:
Main reason is that this code is forever lost because I've been changing laptops. If I remember correctly, what I did was first start an Activity with theme set to @android:style/Theme.NoDisplay. Then in the Activity's onCreate(), make a new MapView (or whatever) keep that view around (maybe as a static var?) so you can use it in your StandOutWindow subclass's createAndAttachView(). You can then finish() the Activity (maybe) and now you have a MapView available for use.

The other reason this code never got uploaded is because it doesn't really ****ing work :( As soon as the backing Activity was finish()'d, the view you kept would start acting all wonky. Feel free to give it a shot though!
[Android Apps and Games] rongtrunghoa:
Special thanks

Great help, thank you
[Android Apps and Games] Mohammad_Adib:
Hey Mark,

I notice that fb chat heads are suuuppper smooth and stuff...how is that so good and standout kinda laggy at times? <.<

Also, fb chat heads hide when watching youtube videos or when apps request the navbar to hide...how do I make standout windows hide when that happens?
[Android Apps and Games] pingpongboss:
Moving StandOut windows has always been super smooth for me. You'll notice that the facebook chat heads never resize, they only move.

You can use a OnSystemUiVisibilityChangeListener to listen for these events. See these 2 links

http://stackoverflow.com/questions/...de-view-setsystemuivisibility-across-restarts

http://developer.android.com/reference/android/view/View.html#setSystemUiVisibility(int)
[Android Apps and Games] pingpongboss:
not sure what you're talking about. Can you take a screenshot of the bottom bar on your transformer?

good idea, I can include a callback when the appicon is clicked.
[Android Apps and Games] Matze2402:
I am currently not at home but I will upload a screenshot as soon as possible! ;)
[Android Apps and Games] Epic_VS:
thank you!!! This is awesome. I have had an app idea in the back of my head for months that needed the floating window like aircalc, but I couldn't find any documentation. I will start to work on this immediately. Also, under what is this licensed. Can I make a paid app? Or do I have to keep it open source?

Thanks. I am very excited about this. As a sidenote, get a PayPal! I am sure many will donate to support this.
[Android Apps and Games] soccer1:
I would love a floating app with maps. I've been wishing for a long time for a floating app that would display google maps with traffic layer, following my real-time gps location.

The other app I've been wishing for is a floating app with weather radar that auto-updates every 5 minutes (or as often as available), and displays my real-time gps location.

I would gladly pay for these apps, as I'm sure would others who drive a lot.
[Android Apps and Games] PoorCollegeGuy:
Hey, doing my part to help get the word out :) this is a pretty awesome project you got going here!

http://www.xda-developers.com/android/standout-shares-library-to-help-devs-create-floating-apps/
[Android Apps and Games] pingpongboss:
Glad you found it useful. You can assume I'll use the most permissive license. MIT license or Apache license or w/e. You will be able to create paid apps with StandOut.

Thanks for the the reminder about PayPal. There's a donate button above my avatar, but maybe I'll put a section on the OP as well.

ok, I'll put a very basic floating maps app up on github when I get the chance. Please have low expectations for it though, the reason I didn't share it immediately is because it is one ugly, half-working hack. Creating a MapView requires an underlying MapActivity (Google's code throws a runtime exception otherwise). I was able to hide the MapActivity, but it still steals touch input, so even though you have a floating map, you can't touch the screen behind the map. And if you press Back or Home, the invisible MapActivity is stopped, and the MapView no longer works.

There seem to be few workarounds:

Find an alternative to MapView (maybe from yahoo, mapquest, or openstreetmap). Osmdroid seems promising.

Find a way to workaround the behavior I described above

Wow, thanks man. If I wasn't vacationing in China I'd be sharing this everywhere :)
[Android Apps and Games] dgcruzing:
Looking forward to a few developers running with this..
[Android Apps and Games] domenukk:
Cool lib!

Awesome idea!

Just one thing:

Now that you have attention I guess it's easy to get some Photoshopping member to create a standard theme that's more androidlike.

If the windows fit the ICS Holo theme, this will be the most epic library ever. ;)
[Android Apps and Games] SWFlyerUK:
How easy would a floating notepad app be?
[Android Apps and Games] pingpongboss:
ha yea I basically just google for icons to use. Anybody up to make this thing look good?

Should be easy enough. You're talking about a notepad where you type stuff, not handwrite, right?
[Android Apps and Games] SWFlyerUK:
Yer where you can write stuff then save the file as a .txt or .html

Would that be easy enough to achieve?
[Android Apps and Games] Epic_VS:
the problem would be with the keyboard. The keyboard would take up half of the screen, unless you use an external one.

An idea - a floating keyboard. :)
[Android Apps and Games] locomain:
Wow Really nice work!!

one question

how to export this?

when i click on export as android app

the project isnt in the list

only the projects i made from scratch can be compiled
[Android Apps and Games] xdaid:
What are you trying to export? StandOut or StandOutExample?

StandOut is not intended to be exported as android app, in fact it is a library. Just make a reference to the StandOut library in your project (in Eclipse, Project -> Properties -> Android -> Library -> Add).
[Android Apps and Games] Matze2402:
So check out the attached picture. Hope you understand?!
[Android Apps and Games] Kevin001111:
Would it be possible to have one or more of these running instead of an app a lightweight launcher? then withing the window/launcher we could run already existing apps.
[Android Apps and Games] locomain:
o then i misunderstood thanks for the reply:D
[Android Apps and Games] pingpongboss:
I see now. Every tablet / phone will have a different place where there is space. I'm working on something that will let you drag a window to an edge, and that window will shrink into an icon. This way you can (probably) drag your window onto the bottom edge and it'll be on top of the status bar.

Yes, it should be easy.

unfortunately, a launcher is different from a window. A launcher lets you pick an application, and it will broadcast an Intent to the android system. The system will then start the application for you, ignoring the launcher that started it in the first place. So you can't contain any apps "within" the launcher. So this is not possible.
[Android Apps and Games] pingpongboss:
We made Android Police's homepage! wow!

http://www.androidpolice.com/2012/0...pp-developers-can-use-to-build-floating-apps/

And now Reddit: http://www.reddit.com/r/Android/comments/uyg69/standout_shares_library_to_help_devs_create/
[Android Apps and Games] tiwiz:
Great lib,

I'm gonna write about it on AndroidWorld.it right now! :)

Tiwiz
[Android Apps and Games] asafkoski:
Thanks

Thank you for the quick response!

I'll get it a shot and update you on the progress.
[Android Apps and Games] sameerg:
emulate hardware event from standout

Hi....I am using standOut to develop an app. I am trying to emulate hardware back button using the following code

view.getRootView().dispatchKeyEvent(new KeyEvent (KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_BACK));

But It isn't working :confused:. Kindly help me pls. Thanks
[Android Apps and Games] cool92guy:
Hi guys, what is the minimum required api for standout to work? I am a new beginner, hope u ppl can help me going.. :)
[Android Apps and Games] pingpongboss:
You may also want to send the ACTION_UP key event.

min sdk version is 7 https://github.com/pingpongboss/StandOut/blob/master/library/AndroidManifest.xml#L8
[Android Apps and Games] Sirence:
Does anyone know a digital clock small app?
[Android Apps and Games] Acela1230:
Thanks so much for this library my friend told me about it a week ago when I complained of not being able to watch the watchESPN app and keep track of time when running on my treadmill since I put the tablet over the screen on the treadmill. So I used your library and created a stopwatch/timer to use. I put it up on the play store if anyone wants to use it.

The library was really easy and straight forward to use and I am already putting it into my next app that I'm making.

edit:

I now can post links here are the links to the app

Free Version:

Pro Version:
[Android Apps and Games] Mohammad_Adib:
Bro, add this

public StandOutLayoutParams(int id, int w, int h, int gravity) {
this(id);
width = w;
height = h;
x = 0;
y = 0;
this.gravity = gravity;
}

This lets RoundR not have to listen for changes in orientation and also when the navbar dissapears in a youtube video the corners go to the corners. Too pro.
[Android Apps and Games] Acela1230:
where would I put that? In the library or in the service? I tried putting it in the service and just get a bunch of problems. What would it change?

I figured out how to fix my problem by making the timer and textview arrays and making the array identifier the id of the window.
[Android Apps and Games] Mohammad_Adib:
I was talking to mark lol. That goes in StandOutWindow ofcourse...where all the other StandOutLayoutParams constructors are declared. What it does is allow windows to be stickied to sides or corners.
[Android Apps and Games] Acela1230:
ahh I see.

I have noticed with my app that when I rotate the screen from landscape to portrait if the window is to far right it wont move over. and i know in your app sidebar it moves to the side correctly when changing orientation. do you change the layout params on orientation change or is there a method to do this in the library?
[Android Apps and Games] Mohammad_Adib:
I use magic :D

Jk. The whole point of that gravity code was to solve the issue you are talking about. Take a look at RoundR source on github just google "RoundR GitHub"
[Android Apps and Games] Acela1230:
I want to put the resize corner into my app but I can't figure out how to do this. I don't want the whole decorations, just the resize corner. I tried putting the flag StandOutFlags.FLAG_ADD_FUNCTIONALITY_RESIZE_DISABLE but this doesn't do anything. Is there a way of just putting in the resize corner or does it have to use the decorations flag?
[Android Apps and Games] pingpongboss:
Yup you figured it out. A lot of people mistakenly think that each class is responsible for one instance of a window. In fact, each class is responsible for any number of windows, of that same type. So like you did, you have to store info on each window in some data structure, and each window needs to be able to take out its own info using its id.

You should make your own minimalistic decorations (don't forget to disable system decorations https://github.com/pingpongboss/Sta...ark/standout/constants/StandOutFlags.java#L23) and put in your own "corner" view with id R.id.corner. Make sure that you don't set StandOutFlags.FLAG_ADD_FUNCTIONALITY_RESIZE_DISABLE so that StandOut can give your corner view resizing powers https://github.com/pingpongboss/Sta...ary/src/wei/mark/standout/ui/Window.java#L521
[Android Apps and Games] Acela1230:
reading this, made me realize that I could just disable those features in the decorations method. So I added two flags, one to remove the titlebar and another to make the border go away. here's the code if anyone else wants to do this as well.

Goes into StandOutFlags.java

/**
* Hides the Title Bar
*/
public static final int FLAG_DECORATION_TITLEBAR_DISABLE = FLAG_DECORATION_SYSTEM
| 1 << flag_bit++;

/**
* Removes border from window
*/
public static final int FLAG_DECORATION_BACKGROUND_DISABLE = FLAG_DECORATION_SYSTEM
| 1 << flag_bit++;

then I had to define the relative layout in the decorations

goes in Window.java > private View getSystemDecorations().

//border
RelativeLayout border = (RelativeLayout) decorations.findViewById(R.id.content);

and then implement the flags

goes in Window.java > private View getSystemDecorations().

if (Utils.isSet(flags, StandOutFlags.FLAG_DECORATION_BACKGROUND_DISABLE)){
border.setBackgroundDrawable(null);
}
if (Utils.isSet(flags, StandOutFlags.FLAG_DECORATION_TITLEBAR_DISABLE)){
titlebar.setVisibility(View.GONE);
}
[Android Apps and Games] kornflexx:
Hi,

I want simulate BACK/SEARCH button onclick, but i have a problem i don't know how to get the activity which is on the background ( not the windows ).

So it's possible with this library ?

many thanks for all this work :D
[Android Apps and Games] kornflexx:
For hide/show window, change in library StandOutWindow:

this:

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

throw new IllegalStateException("Tried to show(" + id

+ ") a window that is already shown.");

}

by:

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

hide(id);

}

so when you call hide like that;

StandOutWindow.hide(context, target, id);

if the windows is hide she will be show

and if she is show she will be hide

have a good day :D
[Android Apps and Games] eyalmnm:
How to do? starting app within a SimpleWindow

Hi,

I'd like to use a floating SimpleWindow as "launcher" to my application.

In the view i have an ImageButton which calling to me app when pressed.

But when i do so; the SimpleWindow still running. How can I close it when ever my app being lunched?

Thanks,

Eyal.
[Android Apps and Games] pingpongboss:
Hmm not sure if this is possible. But here's one direction to try: First use updateViewLayout() to change the window to type OVERLAY instead of TYPE_PHONE. This makes it so the window does not intercept touch/key events. https://github.com/pingpongboss/Sta...c/wei/mark/standout/StandOutWindow.java#L1812

Then send a ACTION_DOWN and ACTION_UP event for back/search. Then change the layout params type back to TYPE_PHONE.

You just need to call hide() with the correct id after you launch your app https://github.com/pingpongboss/Sta...c/wei/mark/standout/StandOutWindow.java#L1158
[Android Apps and Games] emprize:
Thanks for the standout, i just use standout to develop an app,

http://xdaforums.com/showthread.php?p=41402877

On-Screen music controller, provide next, previous and start/pause button to control the song you are listening. It has ticker text to show the song information which are playing

http://play.google.com/store/apps/details?id=com.emprize.musicdroid
[Android Apps and Games] dud3ski:
thank you

hi Mark,

first, i would like to thank you for sharing this awesome project :good:, i was having problems providing Drag 'n Drop support for my overlays and then stumbled upon this page in xda when i searched for overlays and floating windows.

i would just like to let you know that i've used your project/library in developing my app (A919Tool) now published in google play store. your library helped me to finally provide Drag 'n Drop functionality for the app's overlays. thanks again and keep up the good job!

btw, i was able to maven-ize your project/library and successfully add it as a dependency to my maven project. i was thinking maybe i could

contribute this to your project :redface:
[Android Apps and Games] pingpongboss:
You can submit a pull request to https://github.com/pingpongboss/StandOut

Thanks for offering to help :)
[Android Apps and Games] ejezisek:
Great Job Mark

I am currently using this to make an updated version of Floating Draw, for some reason using the overlays previously, I was having difficulties with utilizing the onClickEvents and had to figure out where the icons would display on the screen. This turned into some very buggy work and utilizing your library has helped me produce something a LOT nicer looking.
[Android Apps and Games] dud3ski:
screen orientation bug workaround

cool, will check on how git works.. it's new stuff for me ;)

i've also managed to do a workaround/hack with the screen orientation bug, good thing you have getWindow(int id) method via StandOutWindow class, here's the code (not really that elegant, but it works):

[MENTION=439709]override[/MENTION]
public void onMove(int id, Window window, View view, MotionEvent event) {
super.onMove(id, window, view, event);

if (event.getAction() == MotionEvent.ACTION_UP) {
checkForEdges(id, window);
}
}

public void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);

if (newConfig.orientation == Configuration.ORIENTATION_LANDSCAPE) {
checkForEdges(111, null);
} else if (newConfig.orientation == Configuration.ORIENTATION_PORTRAIT){
checkForEdges(111, null);
}
}

private StandOutLayoutParams checkForEdges(int id, Window window) {
if (window == null) {
window = getWindow(id);
}
Drawable d = getResources().getDrawable(R.drawable.ic_nos);
int w = d.getIntrinsicWidth();
int h = d.getIntrinsicHeight();
Display display = ((WindowManager) getSystemService(WINDOW_SERVICE)).getDefaultDisplay();
DisplayMetrics metrics = new DisplayMetrics();
display.getMetrics(metrics);
int widthPixels = metrics.widthPixels;
int heightPixels = metrics.heightPixels;
Log.i("A919Tool", "widthPixels: " + widthPixels + ", heightPixels: " + heightPixels);

StandOutLayoutParams solp = new StandOutLayoutParams(id, w, h);
if (window.getLayoutParams().x < 0) {
solp.x = 0;
solp.y = window.getLayoutParams().y;
window.setLayoutParams(solp);
}
if (window.getLayoutParams().x > widthPixels-w) {
solp.x = widthPixels-w;
solp.y = window.getLayoutParams().y;
window.setLayoutParams(solp);
}
if (window.getLayoutParams().x == heightPixels-w) { // like Gravity.RIGHT
solp.x = widthPixels-w;
solp.y = window.getLayoutParams().y;
window.setLayoutParams(solp);
}
if (window.getLayoutParams().y < 0) {
solp.y = 0;
solp.x = window.getLayoutParams().x;
window.setLayoutParams(solp);
}
if (window.getLayoutParams().y > heightPixels-h-getStatusBarHeight()) {
solp.y = heightPixels-h-getStatusBarHeight();
solp.x = window.getLayoutParams().x;
window.setLayoutParams(solp);
}
if (window.getLayoutParams().y == widthPixels-h-getStatusBarHeight()) { //like Gravity.BOTTOM
solp.y = heightPixels-h-getStatusBarHeight();
solp.x = window.getLayoutParams().x;
window.setLayoutParams(solp);
}

saveX = window.getLayoutParams().x;
saveY = window.getLayoutParams().y;
window.edit().setPosition(saveX, saveY).commit();

this.sPreferences = PreferenceManager.getDefaultSharedPreferences(this.getApplicationContext());
Editor edtr = this.sPreferences.edit();
edtr.putInt("saveX", saveX);
edtr.putInt("saveY", saveY);
edtr.commit();
Log.i("A919Tool", "saveX: " + saveX + ", saveY: " + saveY);
return solp;
}
[Android Apps and Games] Acela1230:
hey Mark,

I was having a problem with my newest app when a window was closing and still in transition. When the user would try to reopen that window they would get a force close. I was able to narrow it down into the ui.window class and the onInterceptTouchEvent under //focus window. Anyway I think I fixed it by adding third if statement to check the visibility. I was wondering if you thought this might cause a problem somewhere else in the library?

Just in case anyone else might have been having the same problem here is the code:

if (event.getAction() == MotionEvent.ACTION_DOWN) {
if (mContext.getFocusedWindow() != this) {
//Checks to see if a window is still opening/closing
if (this.visibility == Window.VISIBILITY_TRANSITION) {

}else{
mContext.focus(id);
}
}
}
[Android Apps and Games] wutk3ksHD:
There have been issues regarding youtube videos in a webview. However, i got sound working, but no video is shown. Hardwareacceleration needs to be enabled. How do i enable this in your library, Mark?
[Android Apps and Games] taka84104a:
hi

Without knowing that there is such good information, I had developed the original way of me.

I released a floating app.

Please search "portal window,taka84104a" on Google play.
[Android Apps and Games] pingpongboss:
Seems like it may be possible to have StandOut not have any persistent notifications. http://youtu.be/DCUedicPaOg?t=3m30s

If anyone can figure out how to use the Accessibility settings to get rid of notifications then let me know.
[Android Apps and Games] Mohammad_Adib:
Oh sweet :cool:
[Android Apps and Games] kornflexx:
Window orientation

I made a little code:

Window keep his position on the screen after the user change the device's orientation.

[MENTION=439709]override[/MENTION]
public void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);
if (newConfig.orientation == Configuration.ORIENTATION_LANDSCAPE)
ReplaceWindow(id, 0);
else if (newConfig.orientation == Configuration.ORIENTATION_PORTRAIT)
ReplaceWindow(id, 1);

}

private void ReplaceWindow(int id, int orientation) {
Window window = this.getWindow(id);
int w = window.getLayoutParams().width;
int h = window.getLayoutParams().height;
int x = window.getLayoutParams().x;
int y = window.getLayoutParams().y;
Screen = Main.width; // screen width of user, change that
int Screen,newx,newy;

if(orientation==0){
newx = y;
newy = Screen - (w+x);
}
else{
newy = x;
newx = Screen - (h+y);
}
window.edit().setPosition(newx, newy).commit();

}

enjoy :D
[Android Apps and Games] Mohammad_Adib:
Yo Mark, how do you check if Developer Options is enabled?
[Android Apps and Games] pingpongboss:
Are you talking about phone Settings > Developer options?

If you don't see it and you're on JellyBean, go to Settings > About phone > tap Build number a bunch of times until it says you are a developer.

If your question was: How do you tell within a StandOut app, whether Developer Options is enabled on the device.. then I don't know :)
[Android Apps and Games] webDeWo:
StandOut doesn't have any docs, or am I just missing them?
[Android Apps and Games] pingpongboss:
It's long been something on my todo list. But I don't see myself having any time in the near future to do so.

Like they say, the code is the documentation :P read through the library and sample app code and you should be good to go.