Hot answers tagged

7

As the co-founder of Codename One which does pretty much that I can answer that pretty easily. You can cross compile (which is what we do) but you can't have a single binary that will work everywhere because mobile OS vendors don't allow it. Apple doesn't allow JIT's and limits interpreters. All mobile devices include app isolation which prevents a global ...


4

Wow. Function calls are slower than string searches? What implementation of Java are you using? I used to write assembly, and the manual would tell how many "clicks" each instruction took on the processor. Those days are gone, but if I had to guess how many clicks various operations take, I'd guess something like the following: bitwise operations: 1 ...


4

Using a background service won't really help you. The problem is that after a succesful check for wi-fi and server you can't be sure that they are still online while you make your call to get the online data because they may went immediately offline after the succesful check. A better alternative would be to just try to get the live data and if this fails ...


2

You are leaving the radios turned on practically the whole time and this will undoubtedly use up battery. I do see your motivation, however. A decent compromise is to assume that the app is online unless it turns out not to be. If it turns out not to be, and it would like to be, then poll for a connection at long intervals, lengthening as time goes on. 1 ...


2

It's hard to answer this with the information provided. For instance, you say that you're "stringifying" the data, but you aren't saying what method you're using. Is there a library you're using? Is the string JSON, XML, or some other structured data? I'll assume that you're using some type of structured data (for simplicity, let's say JSON using GSON or ...


1

Republish the app with the proper name. There could be legal issues if any of the nodes in the package name are trademarked. Most companies trademark their name, for instance. If they do not prosecute any and all infractions on their trademark, they can lose it (in the US at least). Specifically related to health.com, there are additional terms to ...


1

The operative word here is should. This naming convention is by no means mandatory. And it also has nothing to do with being able to see who created the library. The point is that there is a single flat namespace for packages, and that thus every package ever written, including old packages that are no longer maintained, packages that are currently being ...


1

C# and Java are very similar languages syntaticaly. But what you are really comparing here is the ease of programming for the frameworks you have to use to make apps for these platforms. Ie WPF and the android app framework. In my view WPF and the other various microsoft frameworks have a maturity and 'solidness' which exceeds comparible offerings. You ...


1

Java arrays are length fixed. So when you declare it you should say the size of it. When you are doing: int [] iArray = {0, 1, 2}; you are doing the same of: int [] iArray = new int[3]; iArray[0] = 0; iArray[1] = 1; iArray[2] = 2; So when you try to do an iArray[3] = 3, you are trying to put a value on a position that do not exist on the array, so you ...


1

JSON API is nice, but complex spec. Its implementation is also not easy, especially if you don't have good library implementing it. So it's mostly a question "is it worth it for our use case"? In my opinion, it's worth it if you have large and/or public API which needs to be stable, extensible, will be developed for years. JSON API provides reasonable ...



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