Hot answers tagged

63

In my opinion, that's absolutely not how it's meant. And it's a violation of DRY. The idea is that the entity / domain object in the middle is modeled to represent the domain as good and as convenient as possible. It is in the center of everything and everything can depend on it since the domain itself doesn't change most of the time. If your database on ...


60

I am not a lawyer. There's a special word for people who take anonymous legal advice from the Internet - "fool". Do a risk analysis - a) you don't write the software. outcome: Nothing. b) you do write the software. outcome #1: Sony doesn't notice and/or doesn't care. This might be a case of the "shallow pockets" defense - in their eyes you're not ...


50

No. Most applications from large developers with real, industrial grade copy protection appear in torrents, cracked, within days of release. It is extremely doubtful that a smaller developer can match that. Trying to will just waste your time, leaving less time for you to develop features/apps that make money. You may want to do trivial work to keep "...


33

It is generally true for any public API, yes. Once you expose an API to the public and people start to build applications that depend on that API, it becomes extremely difficult to change the API because doing so will break all those applications. That tends to be both a difficult technical problem and a difficult political problem. Of course, it is ...


33

I am neither a lawyer nor an accountant. What I have done is to register an LLC. You can register an LLC in your state for relatively cheap (hundreds) and you can set it up so that income goes directly to yourself and is taxed as your regular income (it won't be double-taxed like in a normal corp). The LLC will be liable for any suits brought against it, ...


33

Do I really have to make 24 use cases? Only if everything you write is CRUD. Refer to the diagram below: Your assertion is that you will have six different entities, and 4 methods (Create, Read, Update and Delete) for each entity. But that is only true in the yellow circle in the middle of the diagram (the Entities layer). It is pointless to create 24 ...


30

Should I spend time preventing piracy of my app? You are asking the wrong question. Technical safeguards such as proguard are a must but are trying to solve the problem the hard way. The first question should be "Does my app contain something that really needs protecting?" such as a complex or proprietary algorithm. If so the best solution is to move this ...


22

There are well-established patterns for attributing the libraries you use. In general, you put this attribution in the same place where you'd put your copyright notice. In a desktop application: Often there is a menu item “Help > About”, which displays a small info window with the application name, version number, copyright, and developer contact. This ...


20

For this to work, some kind of logic the app uses needs to be under your control. And then without that part of logic the app won't work and you can show a message: "your app is out of date, please download the new version to continue use." Consider a messenger app where traffic goes through your servers. Just refuse to deliver messages of clients using an ...


18

It heavily depends on what kind of syncing you need. Periodic If your app is a news app that publishes posts at a certain time every day(lets say at 7.45 AM every day), then you run a periodic task in a background service, say at 8 AM. e.g.: Drippler. They notify me once every day(around 6.30 PM). I believe they use a periodic task. Event Triggered If your ...


16

Eclipse creates just empty methods that return null (hence "stub"). The comments are inserted to remind the developer that he'll probably want to do something in those methods, otherwise why should they exist? You're supposed to delete the comments when you've done that. If you see those comments all over the place, then either (if the actually contain ...


16

It should not be your responsibility to decide what users need or want to run on their devices. The best way to handle the situation you describe is to notify users that a critical security bug fix has been released and that everybody should update the app.


16

(String ...) is an array of parameters of type String, where as String[] is a single parameter. Now here String[] can full fill the same purpose here but (String ...) provides more readability and easiness to use. It also provides an option that we can pass multiple array of String rather than a single one using String[].


16

Compilers need two things to generate performant code: information and resources. JIT compilers have way more information at their disposal than AOT compilers. Static analysis is impossible in the general case (nearly everything interesting you would want to know about a program can be reduced to either the Halting Problem or Rice's Theorem), and hard even ...


14

(It is customary to preface legal advice on the internet with a disclaimer that one is not a lawyer and you should consult a professional. So here it is: I am not a lawyer. You should consult a real lawyer to be sure.) Anybody can bring suit against anyone else, for pretty much anything. Winning such a lawsuit eventually is a different matter, but where the ...


13

You can try to utilize version control for this, but I recommend against it. Such a requirement is much easier to manage by maintaining only one "version" or "branch" of the application, when you add a compile-time feature toggle for enabling or disabling advertisements. If you like, you can also modify your build process to create always both variants of ...


13

I have more than 20 years of experience and I am profoundly lazy. I work in many platforms. The way I read and understand someone else's code is primarily with my fingers. Why yes I am the kid who was always getting told you don't look with your fingers. I am forever touching the signs that say do not touch. I am fortunate enough to work in a shop where ...


13

If a class is properly encapsulated it's hard to tell if it even has fields from outside. Some classes are immutable. You can't change their fields once their objects are constructed. Your class is also immutable. But not only can't its object change, you only have one way to build it. That doesn't mean you have to think of the whole thing as a verb. It ...


12

Quote author is Joshua Bloch, the statement is from his Bumper-Sticker API Design article: Public APIs, like diamonds, are forever. You have one chance to get it right so give it your best. For more details on that, author refers readers to his conference session presentation, "How to Design a Good API and Why it Matters". Slide Why is API Design ...


12

Nobody but Google knows why they made that decision, but here's my best guess: Android is an open platform, so there are a lot of different hardware configurations out there. Being able to emulate different hardware configurations is a big boon for developers, in that it greatly reduces the need to have actual devices to test on. This keeps the costs down ...


12

Yes, you're right - in general Java requires a lot of ceremony for surprisingly simple situations*. The obvious advantage is that you see each step of the way to your goal, so you have more control. Network communications are done by wrapping messages inside envelopes, so you are exposed to this layering -- your library already hides many layers for you, but ...


12

Note: Sync adapters run asynchronously, so you should use them with the expectation that they transfer data regularly and efficiently, but not instantaneously. If you need to do real-time data transfer, you should do it in an AsyncTask or an IntentService. - source. Basically, if you need real time transfer use IntentService (the first option), else ...


11

As @MrSmith42 suggested, you should do the best you can to mock the interface. You don't need an actual bluetooth connection in order to mock it. Call an interface. That interface, in debug, sends what you'd expect for a given input. When not in debug, it performs the actual work of sending and receiving the data. You be sure that what you send to the ...


11

Its because its simpler - tools can be written to manipulate a XML document far easier than understand java code, so the layout can be created and modified by a simple tool that does not need to also be a java parser. Its also easier for people to describe a layout in XML than in java directly. This technique is used by a lot of things, eg WSDL that ...


11

Your repository doesn't break the "clean architecture", which identifies entities as the core, requires dependency inversion, but doesn't impose to use repositories. But your repository seems to break the clean code principles, and in particular: the single responsibility principle: you pack together things that have different reasons to change: ...


10

Release the App. Because you already coded it, the most you can loose (from a lawsuit) is the generated income from the App. Plus they will likely send you a "Cease and Desist" prior to taking any legal action. Basically worst case scenario is: you are back where you started now, with no revenue. (I would doing this before investing any more development ...


10

Application Licensing The only way to force a user to update to the latest version is to use a licensing schema. There already exists the Application Licensing SDK that will allow you to register user's. Once they are registered you can revoke the license of old versions. Forcing the user to update if they want to continue to use the application. You have to ...


10

Essentially you would need to proxy that web service with one of your own that does rate limiting. The devices wouldn't know anything about each other, and you can cache/re-implement the service if you need to scale further.


Only top voted, non community-wiki answers of a minimum length are eligible