Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
kitten smoothie
Dec 29, 2001

It took a year and a half but some jackass has posted a paid app of mine to half a dozen of those APK share sites.

Is the license service worth implementing or is that something that these guys have figured out how to work around?

Adbot
ADBOT LOVES YOU

Doctor w-rw-rw-
Jun 24, 2008

kitten smoothie posted:

It took a year and a half but some jackass has posted a paid app of mine to half a dozen of those APK share sites.

Is the license service worth implementing or is that something that these guys have figured out how to work around?

Somewhat convoluted to implement and yes, it has been broken. If the pirates are motivated, they may break it. Welcome to the world of DRM. Sucks on the receiving end.

if it turns out to be a reliable way of determining your pirates' identities then instead of halting the app and cutting them off, you can get tricky with them and quietly log them as pirates. Then if your app deals with data, you can introduce glitches. If you have an in-app support form, you can send along its license status, so you can call the pirates out personally, and ask them to buy the application. Or, just shame them: .

kitten smoothie
Dec 29, 2001

Yeah, I was reading through the license manager docs later last night and realize it's way too much time for me to implement something that will probably be just as easily broken.

I just need to look on the bright side. It's a $2 mobile radio app I made for a buddy of mine's station, and the more listeners there are, the more he can claim to his advertisers and make his rate card look better.

I have an Admob-enabled free version of the same app out there, and Admob honestly has paid crap for me. So the person who pirates it probably would have otherwise been one of the tons of people using the free version and barely earning me peanuts on it anyway.

Doctor w-rw-rw-
Jun 24, 2008

kitten smoothie posted:

Yeah, I was reading through the license manager docs later last night and realize it's way too much time for me to implement something that will probably be just as easily broken.

I just need to look on the bright side. It's a $2 mobile radio app I made for a buddy of mine's station, and the more listeners there are, the more he can claim to his advertisers and make his rate card look better.

I have an Admob-enabled free version of the same app out there, and Admob honestly has paid crap for me. So the person who pirates it probably would have otherwise been one of the tons of people using the free version and barely earning me peanuts on it anyway.

Admob is poo poo. YuMe is better, but poorly implemented. Tremor is fantastic.

duck monster
Dec 15, 2004

kitten smoothie posted:

It took a year and a half but some jackass has posted a paid app of mine to half a dozen of those APK share sites.


Theres nothing more depressing than realising that for every copy of some software you sell, your servers are serving 3x that amount.

It pretty much killed the last company I worked at. I mean I get :filez: with stuff like photoshop or whatever from giant companies that are just absurdly expensive for low budget dudes. Its understandable that people would do it , particularly students or people trying to learn a toolkit to break into the industry (but protip: Dont use warezed tools for work, you'll get caught eventually)

But warezing $2 apps from basement devs? Thats hosed in the head, and yet here we are..

But if your product is desirable, well guess what, DRM can't save you and will just annoy legit users who want to keep backups of your software for entirely reasonable reasons. The pirates will barely even notice however, as these things tend to be pretty crackable.

duck monster fucked around with this message at 03:44 on Oct 22, 2012

duck monster
Dec 15, 2004

kitten smoothie posted:

Yeah, I was reading through the license manager docs later last night and realize it's way too much time for me to implement something that will probably be just as easily broken.

I just need to look on the bright side. It's a $2 mobile radio app I made for a buddy of mine's station, and the more listeners there are, the more he can claim to his advertisers and make his rate card look better.

I have an Admob-enabled free version of the same app out there, and Admob honestly has paid crap for me. So the person who pirates it probably would have otherwise been one of the tons of people using the free version and barely earning me peanuts on it anyway.

He needs to make sure he can give an accurate account of how many actual users he has. We had all sorts of problems because we where patent licencing G729 , and the people we where licencing from where grumbling about us having to pay patent fees for the unlicenced users. We where able to eventually convince them that we where not liable for pirated copies, but it definately harmed a business relationship with a company we had worked *hard* to get the licencing up for. The company sublicenced G729 rights without requiring the insane minimum sales requirements of the major patent pool ($100K minimum) but didn't for mobile devices. We had worked with them to get their pool into a sane proposition for mobile licencing, but when we started getting smashed with piracy they started to question if *we* where being honest. What a fuckup.

So with Radio advertising, advertising agencies can get pissy about unverifiable streams, and if you couple this with the fact the RIAA might still want its pound of blood for music licencing fees regarding the pirate copies you still might hve a problem!

The Gripper
Sep 14, 2004
i am winner
Don't feel bad, the licencing departments of a lot of otherwise decent companies get dirty when they think they can get a few extra bucks. They knew they'd be able to call you on pirate/unlicensed usage, and were hoping the dice rolled in their favor and you just paid up instead of disputing it.

Murodese
Mar 6, 2007

Think you've got what it takes?
We're looking for fine Men & Women to help Protect the Australian Way of Life.

Become part of the Legend. Defence Jobs.
Every single time I have to dig into Android to do something weird, I find yet another bug introduced by some idiot loving manufacturer (HTC, you should know better :mad:) who decided to do their own thing and use their own broken loving bluetooth stack / date/time implementation / literally anything, never updates it, never fixes it and makes it impossible to work around.

gently caress you, you are everything that's wrong with open source.

CapnAndy
Feb 27, 2004

Some teeth long for ripping, gleaming wet from black dog gums. So you keep your eyes closed at the end. You don't want to see such a mouth up close. before the bite, before its oblivion in the goring of your soft parts, the speckled lips will curl back in a whinny of excitement. You just know it.
Okay, answer another newbie question? I'm still playing with MonoDroid and I want to learn to draw things. I found about making my own view and overriding its OnDraw event, but that's okay for, y'know, drawing something once and then it never moves again, and also I lose Main.axml which would be a shame. I want to do something really basic, like draw a box and have it change colors or resize every time I click a button or on a Timer tick.

It seems like what I need to do is get the canvas object of the current ContentView, right? Then I could just pass that into a function and have it draw on the canvas. Am I right so far, and if I am, how do I friggin' do that?

kitten smoothie
Dec 29, 2001

duck monster posted:

He needs to make sure he can give an accurate account of how many actual users he has. We had all sorts of problems because we where patent licencing G729 , and the people we where licencing from where grumbling about us having to pay patent fees for the unlicenced users. We where able to eventually convince them that we where not liable for pirated copies, but it definately harmed a business relationship with a company we had worked *hard* to get the licencing up for. The company sublicenced G729 rights without requiring the insane minimum sales requirements of the major patent pool ($100K minimum) but didn't for mobile devices. We had worked with them to get their pool into a sane proposition for mobile licencing, but when we started getting smashed with piracy they started to question if *we* where being honest. What a fuckup.

So with Radio advertising, advertising agencies can get pissy about unverifiable streams, and if you couple this with the fact the RIAA might still want its pound of blood for music licencing fees regarding the pirate copies you still might hve a problem!

We have just as many, if not more, people listening from Stitcher, TuneIn, iTunes, and MP3-enabled shelf systems as we do the mobile app. So in order for an accurate accounting we look at what our streaming server is actually spitting out and how many clients are connected for how long. On that end it doesn't matter whether it's a warezed copy of my app, legit copy, iTunes or whatever else.

And don't even get me started on streaming royalties; we could be here all day :v:

kitten smoothie fucked around with this message at 16:17 on Oct 22, 2012

zeekner
Jul 14, 2007

CapnAndy posted:

Okay, answer another newbie question? I'm still playing with MonoDroid and I want to learn to draw things. I found about making my own view and overriding its OnDraw event, but that's okay for, y'know, drawing something once and then it never moves again, and also I lose Main.axml which would be a shame. I want to do something really basic, like draw a box and have it change colors or resize every time I click a button or on a Timer tick.

It seems like what I need to do is get the canvas object of the current ContentView, right? Then I could just pass that into a function and have it draw on the canvas. Am I right so far, and if I am, how do I friggin' do that?

You have to call invalidate() to cause the onDraw to refresh again. If you are animating or drawing anything dynamically you should look into a SurfaceView instead, that will let you grab the canvas whenever you want.

Murodese posted:

Every single time I have to dig into Android to do something weird, I find yet another bug introduced by some idiot loving manufacturer (HTC, you should know better :mad:) who decided to do their own thing and use their own broken loving bluetooth stack / date/time implementation / literally anything, never updates it, never fixes it and makes it impossible to work around.

gently caress you, you are everything that's wrong with open source.

Yup, just ran into something weird with how the newest RAZR handles Cursors in Awful.apk, it's auto-closing them while they are still in use. It's causing constant crashes for one specific phone model. We handle cursors using the newest API and have zero issues with that code on every other phone out there.

gently caress that poo poo.

CapnAndy
Feb 27, 2004

Some teeth long for ripping, gleaming wet from black dog gums. So you keep your eyes closed at the end. You don't want to see such a mouth up close. before the bite, before its oblivion in the goring of your soft parts, the speckled lips will curl back in a whinny of excitement. You just know it.

Geekner posted:

You have to call invalidate() to cause the onDraw to refresh again. If you are animating or drawing anything dynamically you should look into a SurfaceView instead, that will let you grab the canvas whenever you want.
HA! I guessed that! I made a SurfaceView!

I can't figure out how to grab its canvas. :(

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

Geekner posted:

Yup, just ran into something weird with how the newest RAZR handles Cursors in Awful.apk, it's auto-closing them while they are still in use. It's causing constant crashes for one specific phone model. We handle cursors using the newest API and have zero issues with that code on every other phone out there.

gently caress that poo poo.

The worst part of this is that you just know there's almost zero chance of a fix. I mean, you can kind of hope that a phone will get one update...ever. But, the chances of low-level stuff like this getting fixed in that one update are low.

The one manufacturer issue that still irritates me to this day is that on several (most?) (all?) Motorola phones, the location provider just doesn't report an accuracy figure. It's always zero. Grr.

zeekner
Jul 14, 2007

CapnAndy posted:

HA! I guessed that! I made a SurfaceView!

I can't figure out how to grab its canvas. :(
You'll need to get the surface holder using getHolder(), then you can use the lock canvas method if you are working from a separate thread. I think there is a different method if you are working in the UI thread, just check the surface holder documentation.

Also make sure to look into the surface holder callback interface, it'll let you gracefully handle size changes.

CapnAndy
Feb 27, 2004

Some teeth long for ripping, gleaming wet from black dog gums. So you keep your eyes closed at the end. You don't want to see such a mouth up close. before the bite, before its oblivion in the goring of your soft parts, the speckled lips will curl back in a whinny of excitement. You just know it.

Geekner posted:

You'll need to get the surface holder using getHolder(), then you can use the lock canvas method if you are working from a separate thread.
I don't follow. I lock the canvas so nothing else can touch it, but I still don't have access to the canvas itself, so how can I draw on it?

Maybe what I've actually written will help:
code:
public class Activity1 : Activity
{
	int count = 1;

	protected override void OnCreate(Bundle bundle)
	{
		base.OnCreate(bundle);
			
//		this.Window.AddFlags(WindowManagerFlags.Fullscreen);
	//	this.RequestWindowFeature(WindowFeatures.NoTitle);
		SetTheme(Android.Resource.Style.ThemeLightNoTitleBarFullScreen);
		// Set our view from the "main" layout resource
		SetContentView(Resource.Layout.Main);

		// Get our button from the layout resource,
		// and attach an event to it
		Button button = FindViewById<Button>(Resource.Id.HelloButton);
		SurfaceView view = FindViewById<SurfaceView>(Resource.Id.DrawingView);

		button.Click += delegate { button.Text = string.Format("{0} clicks!", count++); view.Invalidate(); };
		view.Draw(drawSquare();
		view.Invalidate();
	}

	public Canvas drawSquare()
	{
		Canvas result = new Canvas();
	
		Paint paint = new Paint();
		paint.Color = Color.Yellow;
		result.DrawRect(0, 0, 250, 250, paint);

		result.Save();

		return result;
	}
}
This doesn't work.

CapnAndy fucked around with this message at 20:43 on Oct 22, 2012

zeekner
Jul 14, 2007

CapnAndy posted:

I don't follow. I lock the canvas so nothing else can touch it, but I still don't have access to the canvas itself, so how can I draw on it?

Maybe what I've actually written will help:

This doesn't work.

You don't create the canvas directly, you let the OS generate the canvas when you call lockCanvas().

Here's a basic example:
code:
public void onCreate(ect) {
\\ect
surfaceView = (SurfaceView) findViewById(R.id.game_surface);
surfaceHolder = surfaceView.getHolder();
}

public void iWantToRedraw(){
Canvas canvas = surfaceHolder.lockCanvas();
//drawing stuff here
canvas.drawRect(x,x,x);//ect
//when finished, unlock that canvas and it will display the result.
surfaceHolder.unlockCanvasAndPost(canvas);
}
The lock/unlock half can be run from a secondary thread, and there is no need to invalidate anything.

You'll want to look at the SurfaceHolder.Callback interface if you want to handle lifecycle changes better (like the surface getting created/destroyed/resized). This is technically optional, but strongly recommended. For now you can just check to see if the canvas you get from lockCanvas() is null before you use it.

NoDamage
Dec 2, 2000
Does anyone have experience submitting an Android app to the Amazon App Store (in particular, for the Kindle Fire)? We've gotten approval on the Amazon App Store in general, but our app isn't listed as compatible with the Kindle Fire (even though it is technically compatible).

Apparently there's a separate approval process to get onto the Kindle Fire store, but Amazon is being incredibly vague about it.

Since the Kindle Fire was the main reason for us developing an Android version in the first place, this is kind of annoying.

CapnAndy
Feb 27, 2004

Some teeth long for ripping, gleaming wet from black dog gums. So you keep your eyes closed at the end. You don't want to see such a mouth up close. before the bite, before its oblivion in the goring of your soft parts, the speckled lips will curl back in a whinny of excitement. You just know it.

Geekner posted:

You don't create the canvas directly, you let the OS generate the canvas when you call lockCanvas().
Oh poo poo, I didn't realize it did that. I went with the wussy way just to get something working by just making my own custom View so that I could override its OnDraw method, and then pulled a lot of bullshit (giving the view public settable variables that OnDraw paid attention to) to make sure I could manipulate the view with outside events. I'm gonna try that instead, it'll be cleaner.

Murodese
Mar 6, 2007

Think you've got what it takes?
We're looking for fine Men & Women to help Protect the Australian Way of Life.

Become part of the Legend. Defence Jobs.
Anyone done any p2p networking with Android phones? Need some way of ignoring NAT and allowing connections between devices behind incredibly varying types of networks, but preferably without a relay server (or if there is one required, something solid ie. gtalk).

Annoyingly, gtalkservice would've been perfect for this but it doesn't seem to exist anymore, and cloud messaging seems to only be one-way :(

CapnAndy
Feb 27, 2004

Some teeth long for ripping, gleaming wet from black dog gums. So you keep your eyes closed at the end. You don't want to see such a mouth up close. before the bite, before its oblivion in the goring of your soft parts, the speckled lips will curl back in a whinny of excitement. You just know it.

Geekner posted:

For now you can just check to see if the canvas you get from lockCanvas() is null before you use it.
Okay, it's been a bit because I had actual projects to do and those come before learning new stuff, but I'm back to this, and the canvas I get from lockCanvas() is always null. I tried doing this:
C# code:
SurfaceView surface = new SurfaceView(this);
layout.AddView(surface);
Canvas c = surface.Holder.LockCanvas();
c.DrawColor(Color.Green);
surface.Holder.UnlockCanvasAndPost(c);
But that fails because c is null. If I do this:
C# code:
SurfaceView surface = new SurfaceView(this);
layout.AddView(surface);
Canvas c = surface.Holder.LockCanvas();
c = new Canvas();
c.DrawColor(Color.Green);
surface.Holder.UnlockCanvasAndPost(c);
It fails on the UnlockCanvasAndPost, presumably because c has a Height and Width of 0. I'm guessing about why this one's failing, though. All I get is "Java.Lang.IllegalArgumentException".

zeekner
Jul 14, 2007

CapnAndy posted:

Okay, it's been a bit because I had actual projects to do and those come before learning new stuff, but I'm back to this, and the canvas I get from lockCanvas() is always null. I tried doing this:
C# code:
SurfaceView surface = new SurfaceView(this);
layout.AddView(surface);
Canvas c = surface.Holder.LockCanvas();
c.DrawColor(Color.Green);
surface.Holder.UnlockCanvasAndPost(c);
But that fails because c is null. If I do this:
C# code:
SurfaceView surface = new SurfaceView(this);
layout.AddView(surface);
Canvas c = surface.Holder.LockCanvas();
c = new Canvas();
c.DrawColor(Color.Green);
surface.Holder.UnlockCanvasAndPost(c);
It fails on the UnlockCanvasAndPost, presumably because c has a Height and Width of 0. I'm guessing about why this one's failing, though. All I get is "Java.Lang.IllegalArgumentException".

You're really making this a lot more complicated for yourself by trying to use MonoDroid. If you check the documentation for lockCanvas() you'll see "A null is returned if the surface has not been created or otherwise cannot be edited." Even though you added the child view, it still hasn't actually created the layout for that surface. The actual surface creation is done asynchronously outside the onCreate function, and you'll get a callback if you use the SurfaceHolder.Callback interface to monitor the surface.

You're completely skipping XML layouts, which significantly reduce the complexity of creating the surfaceview.

In the second half you just override your existing canvas, which makes no sense. The first canvas is null for the reasons listed above.
Canvas c = surface.Holder.LockCanvas();
c = new Canvas();

Honestly, I would highly recommend just taking the plunge and using regular Java and look at the huge number of practical examples they give you. The LunarLander example is exactly what you need to learn how to handle a SurfaceView, and digging through the other examples will give you a much better idea about how Android works.

CapnAndy
Feb 27, 2004

Some teeth long for ripping, gleaming wet from black dog gums. So you keep your eyes closed at the end. You don't want to see such a mouth up close. before the bite, before its oblivion in the goring of your soft parts, the speckled lips will curl back in a whinny of excitement. You just know it.
Yeah, but on the other hand I need to do it in MonoDroid, because that's what I got told to learn, everything else we do is in Visual Studio, and that way it can be easily ported to iOS with MonoTouch. So MonoDroid it is. I am using an XML layout, though! I think I am! I've got a Main.axml, it's very useful.

Using lockCanvas after OnCreate gets done running does work, so you were right. I'm gonna play with how that works vs. an overrided OnDraw.

I'm sorry I'm a pain in the rear end, by the way.

edit: When I change my SampleView from extending View to extending SurfaceView, suddenly the OnDraw override stops firing. How odd. SurfaceViews don't use OnDraw?
edit edit: Fixed that one on my own. Apparently when you extend a SurfaceView it defaults to WillNotDraw = true. Go figure. At least I'm learning! Unfortunately, OnDraw apparently overrides whatever I did in LockCanvas. So, one step forward, one step right back.

CapnAndy fucked around with this message at 21:40 on Nov 1, 2012

_areaman
Oct 28, 2009

I was planning on writing a boardgame, and then wanted to have my boardgame zoomable, scrollable, animated, responding to touch events easily, and be non-fullscreen. I cursory examination of Android graphics libraries did not reveal anything that did what I wanted to, or at least not easily. Granted, I didn't look that deeply. Therefore, I wrote my own, which has taken a good amount of my limited time for personal projects, and is elegant and easy to use.

Question- would this be useful to anyone? I will take the time to properly open source it, write tutorials, document the API, etc. if this hasn't been done before and people would use it.

5TonsOfFlax
Aug 31, 2001
Yes, please do.

swyys
Sep 20, 2012

_areaman posted:

Question- would this be useful to anyone? I will take the time to properly open source it, write tutorials, document the API, etc. if this hasn't been done before and people would use it.

Yes! I was doing droid development a while back and wrote a lot of custom code for touch events as well. Would love to see (or even help with) a properly parametrized and pluggable libbery.

_areaman
Oct 28, 2009

I shall release it, I'm going to do some optimizations this week and implement new features. Also, I may have confused some with the word "animation". You can move objects and simulate animation, but the architecture of the engine isn't conducive to rapid changes of many objects (garbage collector will go nuts and it won't look smooth). It is meant to be a map or game board of some sort, one that allows you to scroll, zoom, and respond to touch events.

IAmKale
Jun 7, 2007

やらないか

Fun Shoe
Can you guys point me in the direction of any resources that would help me create a dictionary app? This'll be my first attempt at developing something for Android and I figured I'd go all in and (attempt to) make a Japanese-English dictionary. I know XML parsing is going to be involved, but I have no idea what best practices are with regards to storing and querying information stored in a hundred megabytes of XML. Do I query the XML directly? Do I import it into some kind of SQL engine? I've never had to deal with this much information before.

Tamba
Apr 5, 2010

Searching thorugh massive piles of XML souns like a performance nightmare, so importing it into some kind of database is probably your best bet.

Or, if you want to cheat, you could look at how aedict did it
https://code.google.com/p/aedict/

Doctor w-rw-rw-
Jun 24, 2008

Karthe posted:

Can you guys point me in the direction of any resources that would help me create a dictionary app? This'll be my first attempt at developing something for Android and I figured I'd go all in and (attempt to) make a Japanese-English dictionary. I know XML parsing is going to be involved, but I have no idea what best practices are with regards to storing and querying information stored in a hundred megabytes of XML. Do I query the XML directly? Do I import it into some kind of SQL engine? I've never had to deal with this much information before.

I'd probably pre-digest it into a sqlite db and include that with the app rather than parse XML, license for said information allowing. Then you can point cursors to it and use all the built-in database stuff.

shodanjr_gr
Nov 20, 2007
Does the latest version of Android (4.2 JB) expose the OpenGL ES 3.0 APIs, considering that the Adreno 320 in the S4 Pro supports it?

Hot Yellow KoolAid
Aug 17, 2012
I took an android class this summer (though I don't have a phone, planning on buying one for christmas) and I don't know how to install the .apk file from a finished project onto an android device. I have read so far that the file can be sent to a device as an attachment to an email, but I'm not sure how to install it/where the file is stored on the device from there. Is there an easy way to install an app from an .apk file?

zeekner
Jul 14, 2007

Hot Yellow KoolAid posted:

I took an android class this summer (though I don't have a phone, planning on buying one for christmas) and I don't know how to install the .apk file from a finished project onto an android device. I have read so far that the file can be sent to a device as an attachment to an email, but I'm not sure how to install it/where the file is stored on the device from there. Is there an easy way to install an app from an .apk file?

There are plenty of easy ways to do it, but I typically just use ES File Manager. It can connect to a Windows file share or Dropbox, then you just tap the apk file and it'll offer to install it.

Alternatively, you can email the file or a link to the file hosted online somewhere. If you download it to the external/SD storage on the phone, you can tap the notification entry for that file to automatically install it.

Either way, make sure to enable the "Unknown Sources" in the phone's development options beforehand.

Munkeymon
Aug 14, 2003

Motherfucker's got an
armor-piercing crowbar! Rigoddamndicu𝜆ous.



You can also connect the device to your development machine and run adb install <filename>.apk. Assuming you have the device set up for that, of course - see Geekner's post.

http://developer.android.com/tools/help/adb.html

Sereri
Sep 30, 2008

awwwrigami

I connect my device via usb, enable dev mode, press run in eclipse and it works :downs:

Giant Goober
Nov 6, 2009
I downloaded the sdk's and managed to get a few of the samples running last night. I noticed in JetBoy that there is a lot of subclasses in the view and that the members on objects are all public with no getters and setters. Is this standard practice for android development, or it quick implementation of the samples?

I prefer giving each class it's own file as I find it much easier to follow.

zeekner
Jul 14, 2007

Giant Goober posted:

I downloaded the sdk's and managed to get a few of the samples running last night. I noticed in JetBoy that there is a lot of subclasses in the view and that the members on objects are all public with no getters and setters. Is this standard practice for android development, or it quick implementation of the samples?

I prefer giving each class it's own file as I find it much easier to follow.

They try to minimize the size of those examples, to make it easier to figure out. It is pretty normal to use anonymous inner classes for little things like OnClickListeners and such. But yea, just follow whatever Java style guide you feel is best for you, you won't run into any real issues.

I shudder every time I see Enterprise™ quality code in an android app. Google put a lot of effort into making Dalvik a simple, straightforward Java.

Giant Goober
Nov 6, 2009
Thanks, I was making sure I hadn't missed a 'best practices' memo somewhere. I mostly work with GWT so I'm hoping it wont be too bigger jump to android.

Doctor w-rw-rw-
Jun 24, 2008

Geekner posted:

They try to minimize the size of those examples, to make it easier to figure out. It is pretty normal to use anonymous inner classes for little things like OnClickListeners and such. But yea, just follow whatever Java style guide you feel is best for you, you won't run into any real issues.

I shudder every time I see Enterprise™ quality code in an android app. Google put a lot of effort into making Dalvik a simple, straightforward Java.
I am somewhat guilty of this, having just discovered IntentServices and (Detachable)ResultReceivers as a substitute for using AsyncTasks to make network calls with a callback-like pattern. It's not awesome, but it's sufficient, and still works when specifying the service to run in its own process.

Live and learn. Can't build something good without building a few horrors along the way, I suppose.

zeekner
Jul 14, 2007

Doctor w-rw-rw- posted:

I am somewhat guilty of this, having just discovered IntentServices and (Detachable)ResultReceivers as a substitute for using AsyncTasks to make network calls with a callback-like pattern. It's not awesome, but it's sufficient, and still works when specifying the service to run in its own process.

Live and learn. Can't build something good without building a few horrors along the way, I suppose.

That's pretty reasonable for network calls though, we use a message-passing service to do them in Awful (since 2.2) and it simplified the hell out of networking and failure fallbacks.

Adbot
ADBOT LOVES YOU

Doctor w-rw-rw-
Jun 24, 2008
:frogsiren: :frogsiren: HOLY loving poo poo :frogsiren: :frogsiren:

https://github.com/jfeinstein10/SlidingMenu

Compile the example and try it out, or install it from the App Store: https://play.google.com/store/apps/details?id=com.slidingmenu.example

This actually works.
Amazingly well, in fact.
Even on 2.1.

As an Android developer I can't understate just how much this library will improve my quality of life. Dunno if anyone else is as thrilled by the existence of this library as I am.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply