It's certainly possible to develop on a Windows machine, in fact, my first application was exclusively developed on the old Dell Precision I had at the time :)
There are three routes;
- Install OSx86 (aka iATKOS / Kalyway) on a second partition/disk and dual boot.
- Run Mac OS X Server under VMWare (Mac OS X 10.7 (Lion) onwards, read the update below).
- Use Delphi XE4 and the macincloud service. This is a commercial toolset, but the component and lib support is growing.
The first route requires modifying (or using a pre-modified) image of Leopard that can be installed on a regular PC. This is not as hard as you would think, although your success/effort ratio will depend upon how closely the hardware in your PC matches that in Mac hardware - e.g. if you're running a Core 2 Duo on an Intel Motherboard, with an NVidia graphics card you are laughing. If you're running an AMD machine or something without SSE3 it gets a little more involved.
If you purchase (or already own) a version of Leopard then this is a gray area since the Leopard EULA states you may only run it on an "Apple Labeled" machine. As many point out if you stick an Apple sticker on your PC you're probably covered.
The second option is more costly. The EULA for the workstation version of Leopard prevents it from being run under emulation and as a result, there's no support in VMWare for this. Leopard server, however, CAN be run under emulation and can be used for desktop purposes. Leopard server and VMWare are expensive, however.
If you're interested in option 1) I would suggest starting at Insanelymac and reading the OSx86 sections.
I do think you should consider whether the time you will invest is going to be worth the money you will save though. It was for me because I enjoy tinkering with this type of stuff and I started during the early iPhone betas, months before their App Store became available.
Alternatively, you could pick up a low-spec Mac Mini from eBay. You don't need much horsepower to run the SDK and you can always sell it on later if you decide to stop development or buy a better Mac.
Update: You cannot create a Mac OS X Client virtual machine for OS X 10.6 and earlier. Apple does not allow these Client OSes to be virtualized. With Mac OS X 10.7 (Lion) onwards, Apple has changed its licensing agreement in regards to virtualization. Source: VMWare KnowledgeBase
Finally, Google released an official version of the pull-to-refresh library!
It is called SwipeRefreshLayout
, inside the support library, and the documentation is here:
Add SwipeRefreshLayout
as a parent of view which will be treated as a pull to refresh the layout. (I took ListView
as an example, it can be any View
like LinearLayout
, ScrollView
etc.)
<android.support.v4.widget.SwipeRefreshLayout
android:id="@+id/pullToRefresh"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ListView
android:id="@+id/listView"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</android.support.v4.widget.SwipeRefreshLayout>
Add a listener to your class
protected void onCreate(Bundle savedInstanceState) {
final SwipeRefreshLayout pullToRefresh = findViewById(R.id.pullToRefresh);
pullToRefresh.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
@Override
public void onRefresh() {
refreshData(); // your code
pullToRefresh.setRefreshing(false);
}
});
}
You can also call pullToRefresh.setRefreshing(true/false);
as per your requirement.
UPDATE
Android support libraries have been deprecated and have been replaced by AndroidX. The link to the new library can be found here.
Also, you need to add the following dependency to your project:
implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'
OR
You can go to Refactor>>Migrate to AndroidX and Android Studio will handle the dependencies for you.
Best Answer
We are doing a similar type of referral system in our app which provides certain amount of Reward Points to the referrer (one who actually shared the link to app) on successful install of the app by new user (one who received the link).
I will try to explain our implementation using your scenario: So according to your user story:
Every new user (E.g John) is given a unique referral link, which he/she can share it to his friends using FB/TW/Email or SMS.
When John's friend clicks on the link, he is re-directed first to a Servlet which eventually redirects him to respective AppStore based on his platform (Android/iPhone) to download the app.
Note that we can find out the IP address, user agent and device model of the user who clicked the link using a Servlet.
We already know that the referral link belongs to John and hence the servlet maps the IP address,user agent and/or device model of John's friend to John's entry in database.
The moment John's friend installs the app, and opens the app, the application sends the IP address, user agent and/or device model to the server.
The server checks the entry against all the user to find the referrer and if it finds him, in our case John, John gets rewarded accordingly..
Thats it. We implemented this in the last month itself and it does increased our downloads. Let me know if that's helpful.