What is equivalent for Windows API in Android? [duplicate] - java

I am new to android programming and I wanted to create an application(vocabulary enhancer/words reminder which I already have for windows ) which pops up at certain time intervals to remind the words I saved earlier.
I thought android programming would be like programming windows which uses visual studio 6 or the latest.
I created a simple hello world program but it involved too many XML and other file references and inclusions.
Is there a way to create applications for android like win32 SDK using which we can create applications for windows. Like createwindows and other straight forward methods instead of having something like mfc or the one android programming uses ?

I have no idea what's "too many XML", other than a great name for a band.
If you're serious in your question, then I suggest you begin here: Comparisons of the Android framework's structure to the MFC/Win32's structure? and work your way forward.
Otherwise, I suggest you do form that band.

There is no equivalent to the Win32 API for Android. The closest you will get would be to talk to the (native) Linux OS. But that will only work if your device is rooted.
And that is the point. Something like the Win32 API would allow an Android app to do things that can interfere with other apps ... and compromise the security of the user's device.

Related

how to write an android app with languages other than java

my title is a little different than what i try to say, i couldnt exactly tell what i mean.
as far as i know we develop android apps with android studio(and there were support for other ide s like eclipse before) you code it and make a gui app with drag and drop.
recently i tried to open source code of few android apps like whatsapp. i extracted the classes.dex file and checked the source code. it was written with java. but when i google "whatsapp" it says it is written with erlang.
my question is, how the code written with erlang turns to a java code? as far as i know you can make android apps with c++ too. since we dont have a translator for languages, how is this being possible?
WhatsApps backend is written in Erlang, not the app
https://www.quora.com/Is-WhatsApp-fully-written-in-Erlang
Android uses the Java Virtual Machine (JVM) runtime. To run Android apps on a phone you either need to write them in a JVM language (Java, Kotlin, Scala), or write them in another language and that has a rumtime interpreter on the device (Javascript + Android Webview, Flutter + Flutter Runtime)
You can write your app in just c++, but then you won't have any of the Android SDK available to you. You'd have to rebuild the entire view plaform (among other things). Flutter does this.
If you have more specific questions I'd be happy to answer them

real time turn by turn navigation using Skobbler APIs on a Java app

I am trying to develop a java app that will run on a Raspberry PI. Raspberry PI will be mounted on a vehicle and I will know my position through a gps device. To solve this, I’ve been thinking on a solution like this:
Use a Webview on my JavaFX app and use your javascript API to build a real-time turn by turn navigation app. However, I’ve seen that your web API is not as complet as mobile platforms APIs. My question is: Is what I am trying to do feasible using your APIs? If so, could you please give me a brief description how to do it?
Thanks!
The Javascript API is not a turn by turn API - that is currently something a bit too heavy for javascript to handle (it could be feasible but it's not commercially attractive right now).
In theory you could integrate directly with the C++ code of the SDK as that should be able to run on Linux (depends here on the gcc version used and the OpenGl support offered - send an email to dev#telenav.com with your scenario and they will advise you).
Or if you can run Android on the device then you can use directly the Android SDK.

Is is possible to write app for iOS and move object-c code into Android?

Today I was speaking with PM. He said that the best way to solve problem "The same app working on iOS and Android" is to write object-c code for iOS and then use the same code in Android app (https://developer.android.com/tools/sdk/ndk/index.html). That approach (in his opinion) will give us DRY effect (have one code to maintain).
I was so shocked that I almost didn't say anything to it. But after some time I think about it and found some problems:
C++ != Object-C. It is possible to add o-c code as c++ code in Android?
(Let say that #1 is possible) How can I do layouts, activities, ect. in c++ for Android?
Also when we should / should not use Android NDK?
The short answer is no it's not possible. However http://www.apportable.com
Claims to enable you to compile your iOS app for Android - thus enabling you to use all of the code in your iPhone app.
However it doesn't work with everyframe work but does have hooks in to the Android SDK so you can still access those components. Worth looking at, and having a play with. I have but only half-heartly and you'd have to build the iOS app from the outset with the plan to use http://www.apportable.com as like I said it doesn't currently support all ios sdks and you'd need to work around that.
But that should answer your question.
As of 2016 app portable is no longer an option more info it appears Google killed the dream.
Objective C code will not compile with the NDK. But check out http://www.apportable.com/ it's a library that allows you to write code for Android in Objective-C. That could be what your boss was talking about.
C++ < Objective-c. Objective-c is built on top of a C compiler ... Just name the files with *.mm and write c/c++ code. Basically what you could do is write functions that you want to share across platforms in c++ and use them in an Android project via JNI wrappers.
You can not share code which uses ios system Frameworks (UIKit, CFNetwork, ...) directly.
If you want to write code for whole apps once, you could give it a shot with apportable.com, like others have pointed out.
You can use the GNUstep Android toolchain to use model code based on Foundation and CoreFoundation in an Android app, and then write a new UI layer that interacts with the Objective C model via native NDK calls on top of that (e.g. in Android Studio).

Making an Android application that cannot be uninstalled/deleted

I want to make a security app for Android phones. Basically, I don't want anyone to be able to un-install it without having to enter a specific password first.
Also, is there a way to prevent the app from being stopped manually (like being closed via. Taskmanager) etc?
This sounds more akin to Malware-like behaviour than that of a regular Android application, anyway:
For a regular Android application, I'd imagine that making it 'uninstallable' is near enough impossible to achieve - try to contemplate what the state of the Android app market would be like right now if this were possible!
On the other hand, if privileged control (root access) was available then this might be a possibility - an example of that could be like how wireless carriers implement bundled software. However, like I mentioned, there is no regular avenue available for applications released via. the Android market to achieve what you've asked, it should be pretty clear to you why...

J2ME app to access incoming call - Where to start?

Here's my requirement:
I often receive calls from unidentified numbers on my mobile phones. I would like an application which would use a reference list like this, and show me the carrier name and the area of origin along with the number on screen.
Mobile make : Sony Ericsson
Model : C902
Operating System: Propreitary
J2ME: MIDP 2.0
Here are my questions:
Is it possible to do something like this? I have installed a lot of java apps on my mobile, and all of them have to be launched seperately, can be run in the background, but they never seem to access anything native.
If it is possible, which area of J2Me should I start with, for creating an application that achieves the above requirement?
If it is not possbile, what are my alternatives?
I'm pretty sure this isn't possible. I dabbled in J2ME for a while, and came to the conclusion that it's basically just a big joke hard to do anything meaningful. Sorry.
can be run in the background? yes using Push Registry. access anything native? it depends on which native thing you want to access.
It is not possible.
On this model, you don't have alternatives, but on Symbian you can try Qt with help of Qt Mobility Project

Categories