Android native internet access: download files - android

I want to download files from internet in my Android Native application. I was searching for reference to it on the net but couldn't find any.
Could somebody please tell me if it is even possible and if it is what to look for or where?
Is there a ported C++ library that can do this?
Thanks

There are C libraries that can do Internet access - libcurl comes to one's mind - but why not use Android's builtin Java stack?

Check your manifest to make sure you allow internet access, modify information on sim card, etc.
Now you have access to the sim card and the internet. From that point on, you can do that stuff.
Also, I noticed you mentioning a C++ library? Android is done in java mostly unless you are doing something cross platform like the cocos-2d-x which is written in C++

Related

java applet to android workflow

I have built an interactive taxonomic key and the output is a java applet. I want to covert it onto an app that can be used locally ie on phone for example with no connection to the internet (its important as people on project are working in remote locations).
My question is can I edit the java applet in Android studio? Willing to learn just want to know what the best approach is. later would need to work on it being available on IOS devices too.
Thanks, Amanda
Java applets and Android apps have nothing in common with each other, other than language. The UI and input frameworks are totally different. You could share some of the logic of the app if you put it into a jar file, but you won't be able to share anything else. And Java doesn't run on iOS, so that's totally out.
Also, not sure why you tagged this javascript. Java and javascript are totally different languages. A Java applet has nothing to do with javascript.

FUSE (Filesystem in Userspace) support on Android

I'm trying an app that require to enable a cloud based file system to my device. For this I've to have FUSE support in my Android device . I'm using Android version 4.4.2 on a Asus tablet. However I searched a lot but couldn't find some satisfactory answer to ensure that whether Android support Fuse. Thus I have few question as below ,
1.According to my search result When I run cat /proc/filesystems on an app (Terminal Emulator for Android) that provides Linux terminal I found the result of cat shows "Fuse" there . Is that mean my system support Fuse interface to allow install an user space file system ?
I also found in some forum either Fuse should come as built inside kernel or it should be as fuse.ko module under /system/lib/module . But my system doesn't contain fuse.ko hence does it mean I don't have fuse ?
In short, my question is how to ensure FUSE on android device ? I'm a beginner in Android programming so any help is much appreciated . Thanks in advance.
Modern versions of Android utilize Fuse internally, for example to implement the emulated External Storage.
However, Android is locked down and so neither 3rd party applications, not in most cases the human user, are allowed to add additional filesystems.
For stock Android the only choice will be to implement file-system-like operations within application code, creating a private API that replicates basic file operations, without actually using any files. Anywhere in the code you are writing or porting and need to access one of the remote "files", you would substitute your API for the actual file one. A good example of this would be Android assets - they look a lot like files and have many similar operations, but at runtime they actually are not files but an Android-unique storage mechanism.
Anything else would require modifying Android away from stock configuration (ie, root hacks, etc).
To check what your version of Android on your device supports, download a terminal emulator, and from the command line, run the following snippet of commands minus the parentheses...
"cat /proc/filesystems"
And scroll through the results looking for fuse. This will be a list of supported filesystems weather it be compiled into the kernel or loadable module.

Turn On GPS using NDK

I have read a lot of posts about managing GPS in android using code.
All of them saying that it is not possible. But they are all using android SDK to talk about the topic. Since it is not possible with SDK, can it be done using NDK?
I am asking this question, even after reading all those, because the android settings application can enable/disable it, which means it is not impossible.
In my app, it needs to turn GPS for a while and turn it off (for power reduction) and send the GPS data to a server.
Ultimately android is Linux based. So there must a way to turn it on/off using the Linux commands/APIs right? (or using the NDK) can anyone share the ideas about that?
If it is not at all possible (last option), is there any alternate way to get location information using any other functionalists.
In general, the Android NDK interface is much more limited than the SDK interface. To supplement it, you are able to access Java functions through the JNI interface. There is no extra functionality in the NDK that does not already exist in the Java SDK.

How do I raise an Android Intent using Qt Necessitas SDK?

I'm developing an Android application using C++ and Qt Necessitas SDK.
My application should load/save files and I want to handle it using Android actions ( so that I can target Google Drive as well as Dropbox etc... )
The question is... how do I raise Intents ( and which Intent should I raise to share/import my files ) from C++ ?
Rationale: how do I load and save files ( either custom mimetype, or pdf ) using Qt Necessitas on Android?
I'm a complete newbie to java and I know nothing of JNI, but apparently this link will explain how to [use the JNI to] use intents in your QT for Android applications: http://community.kde.org/Necessitas/JNI
It looks pretty straightforward, but I'm afraid I don't yet understand what I'm reading enough to give you a better answer to your question.
Sources:
groups.google.com/forum/?fromgroups=#!topic/android-qt/U3eHis9mLrg
groups.google.com/forum/?fromgroups=#!topic/android-qt/UpgBRz8Imwo
Another option for a some things (opening websites, making phone calls, possibly opening local PDFs and images) would apparently be QDesktopServices::OpenURL() - although that seems to give open-only access (ie, opening the resource but not pulling any data back from it).
I'm interested in this so that I can use the barcode scanner app "ZXING", which has an intent-as-url at http://zxing.appspot.com/scan - I don't know what other little secrets are out there...
HTH until someone can give you a better answer
(2 links disabled due to insufficient reputation)

Traceroute on android

I am a beginner on android platform, and I want to build a tracerouting app. So these are my queries:
Is it possible to make such an application in Android? if possible then guide me the way that I follow.
Does Android support low-level programming to capture ICMP packets? or do I need to add some kind of JAR (in java) or some other libraries to support this application?
In Java, there are JPCAP and docjar etc kind of libraries that we can import in our IDE or Eclipse so that Java support for making such kind of API's?
I need valuable suggestions.
It's quite late - but someone might see it.
i found this one and it worked for me:
https://github.com/olivierg13/TraceroutePing
The simplest way I can think of is to just check for the traceroute Linux application, execute it, and parse its output.
Android has full networking support, however, Java doesn't expose an interface to alter the IP header. Hence, manually crafting ICMP packages is out of the question (JPCAP is no help here, since it relies on libpcap, which I suppose you won't find on any vanilla installation).
Another possible solution is to use the NDK and create a small library that handles the low-level number crunching. However, I'm not sure if the NDK would allow you to use setsockopt.
This is working pretty well for me, you may have to filter out the string results.
To add this library, you have to download or clone the git repository and implement the folder "library" just as he does in the other module "app" for it to work properly.

Categories

Resources