Skip to main content
14 votes
Accepted

Unit test which asserts that current thread is the main thread

Let me show you my favorite unit test principles: A test is not a unit test if: It talks to the database It communicates across the network It touches the file system It can't run at ...
candied_orange's user avatar
10 votes
Accepted

Unit Testing in VIPER Architecture: Possible?

Oh it's possible. It just doesn't look like what you want it to look like. What you're complaining about is the use of output ports1,2,3 to communicate results rather then returning results. Does this ...
candied_orange's user avatar
10 votes
Accepted

The right place for "app logic" in MVVM context

In MVVM, the business logic is built into the Model. The ViewModel is there to bridge between the View and the Model, so it's logic only pertains to driving the display and updating the model from ...
Berin Loritsch's user avatar
9 votes

Why are there no cross-platform mobile applications?

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 ...
Shai Almog's user avatar
9 votes
Accepted

Keeping version parity between platforms

When most of your code base is shared for both platforms, I would avoid getting version numbers "out of sync", because it will bring a lot more effort for writing a coherent changelog or ...
Doc Brown's user avatar
  • 210k
7 votes

JSON API or Plain JSON

I'm not interested in JSON, I'm interested in the objects that are created from JSON. Like in your example, turning plain JSON into objects is easy. How difficult is it for new developers? Mostly they ...
gnasher729's user avatar
6 votes

What is a good approach for saving a Swift model that's a struct containing structs to Core Data?

You have some options: 1 - Convert them to class. So you can inherit from NSManagedObject and do the rest like the tutorials you usually find in internet. 2 - Make a rapper around any struct you ...
Mojtaba Hosseini's user avatar
6 votes
Accepted

In mobile games that work across android and iOS is game logic written twice?

Three words: cross-platform compatibility. If you write your game in HTML and Javascript, it will run on any platform where there is a web browser on the device (which is most devices nowadays). If ...
Robert Harvey's user avatar
6 votes

Can you modify the front-end source code of a mobile app?

It's not just that people might be able to hack into your front-end app. They might be connecting directly to your server with an app that they wrote themselves. I can get around whatever security ...
gnasher729's user avatar
5 votes

Private apps for iOS and Android

You can develop and distribute private apps among selected clients. In iOS, ad-hoc distribution is there, but you'll need to hook up your mobile device to a Mac OSX. Ad-hoc distribution is possible ...
TroublingCushion's user avatar
5 votes
Accepted

What would cause a company to need to move their app on the iOS App Store to different "app"?

If one builds an app with 64-bit support using current versions of Xcode, it is no longer compatible with iOS devices running iOS 5.0 or earlier. Perhaps a developer wants to separately support ...
hotpaw2's user avatar
  • 7,978
5 votes
Accepted

What should a rest api return for an empty guid?

An 'empty' guid is still a valid guid, so parsing it shouldn't require any extra logic. The question is why are you using it at all? It seems like a mistake to me to assign special meaning to a ...
Ewan's user avatar
  • 77.5k
5 votes
Accepted

Why JS MVC frameworks prefer data binding to UI element reference?

The purpose of data binding is to decouple the view from the model. Neither the model nor the view should know about each other. Data binding is the glue that connects the model to the view and ...
Robert Harvey's user avatar
5 votes

Push notification from web application to my mobile app

There is no need to reinvent the wheel and there are plenty of solutions out there that makes pushing notifications to mobile devices easier. I personally would recommend Firebase Cloud Messaging by ...
Dean Meehan's user avatar
5 votes
Accepted

Can you modify the front-end source code of a mobile app?

Yes of course. People like to think that because a lay person can't read the source code for compiled or even "transpiled" applications in the same way you can with javascript on a website that it's ...
Ewan's user avatar
  • 77.5k
5 votes

How do I mock API responses with security in mind?

Rather than sprinkle such conditionals throughout your program, refactor the code so that all communication goes through a single, minimal communications specialist. Then replace that specialist with ...
Kilian Foth's user avatar
4 votes

Making profit using OpenCV?

The About Page says: OpenCV was built to provide a common infrastructure for computer vision applications and to accelerate the use of machine perception in the commercial products. Being a BSD-...
Alan Shutko's user avatar
  • 1,400
4 votes

JSON API or Plain JSON

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 ...
qbd's user avatar
  • 2,916
4 votes
Accepted

How does an app send an order to a retailer? What happens under the hood?

I am wondering how does the retailer apps works which allows user to choose an item and once user have selected & checkout, the retailer get information about order been placed. Typically the app ...
candied_orange's user avatar
4 votes

Framework logs on client application

Can you not make it configurable? Almost any Android library that does network requests I know does one of the following: Have a config file and/or setter on some class where you can activate logging ...
Hendrik Marx's user avatar
4 votes

Which applications are developer environments and operating systems coded in?

New is made from old. iOS was developped on Macs and first Macintosh software was programmed on Apple II computers. At the beginning, programming was like that (picture from: 70 years ago, six ...
mouviciel's user avatar
  • 15.5k
4 votes

Architecture of mobile backend

An API is high level enough to expect it to do multiple things with a single action. If I have an endpoint that does a "Buy Product" then I would expect it to handle all of the transaction handling, ...
jakedipity's user avatar
4 votes

Different feature set in multiple mobile apps from the same code base

I don't know how modular the code is, but in order to handle the complexity of all of this it might be useful to create API layers. The core library has the features/functions in all apps, with ...
Berin Loritsch's user avatar
4 votes

Battery Impact: Idle vs Busy Websocket on iOS

According to this research paper: HTML5 Connectivity Methods and Mobile Power Consumption, you do consume a significant amount of energy maintaining an inactive websocket, because it is sending ...
Ross Gatih's user avatar
4 votes
Accepted

Best Practice for handling data sync with React Native, MobX and REST?

The best practice is to use persistent storage which facilitates offline-first development and offers built-in client/server data sync, such as PouchDB/CouchDB: The PouchDB API provides a method for ...
4 votes

Unit test which asserts that current thread is the main thread

Should you write a unit test which tests if a thread is the main thread? Depends, but probably not a good idea. If the point of a unit test is meant to verify proper functioning of a method, then ...
Neil's user avatar
  • 22.8k
4 votes

Why are cloud services needed for push notifications?

Well, there are third party services which offer push notification functionality and work over standard ports (443 / HTTPS). (Apple Push Notification Services requires non-standard port numbers 2195 ...
Glorfindel's user avatar
  • 3,147
4 votes

How to make sure the file is uploaded from my application

Short answer: Not Possible Longer answer: As soon as you lose control of the hardware (i.e., your software is running on a phone that you don't own) you can no longer guarantee that the software ...
Dan Pichelman's user avatar
4 votes

Why local database should be the only source of truth for mobile application?

You need a single source of truth. Having a single source of truth that is always available is very handy. It really makes life easier if you use an always available database as single source of ...
gnasher729's user avatar
3 votes
Accepted

Did Apple violate OCP back when they released iOS 7

I'll answer my 3 y/o question by saying that OCP principle has nothing to do with API changes, but abstraction patterns when designing classes.
Christopher Francisco's user avatar

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