[Q] Native app (C++) for Windows Mobile 7? - General Questions and Answers

Hi all,
As far as I known, after a WM7 phone is unlocked (jail-broken) and apply root-cert, we certain take the root permission of the phone.
What I'm going to ask is that is it possible to install a native app to this phone? A Native app may be a script, a console app (without GUI), or an executable code that run in background and able to access to system resource such as SMS, phone and can use socket connection as well ?? I guess if it is possible, we must use another development tool/compiler (GCC e.g) instead of M$ studio.
Any help will be appreciated.

Related

[Q] Connecting to DBUS API on unrooted Android phone to connect an HID device

Hi everyone,
I'm trying to write an android program which will allow users to connect to an HID device. The device captures external pen strokes and I would like to retrieve this data and make a basic whiteboard app.
I've made some progress so far: if I use adb push to put the "hidd" daemon on a rooted phone and use hidd --connect, then I can open up hcidump and see the raw data appearing when the pen is used, so I know such a connection is possible.
I'm still a beginner at Android development, but I've learned that app communication with the bluetooth facilities is done via the dbus API. So, I wrote a simple test program using the NDK that tries to make a connection to the system dbus, based on some bluetooth-related code in mydroid/bin/frameworks/base/core/jni:
DBusConnection *conn = dbus_bus_get(DBUS_BUS_SYSTEM, &err);
On my non-rooted phone, this results in the error "VERBOSE/JNI1Activity_DEBUG(3226): Result: Could not get onto the system bus: Failed to connect to socket /dev/socket/dbus: Permission denied."
If I go ahead and do chmod 666 on /dev/socket/dbus on my rooted phone, then the connection can be made without error.
So, my question is this--first of all, am I going about this the right way? If so, is there some way that an application can get permission to talk to dbus on a non-rooted phone?
(If I can get this working, I think the next step would be to try and package/build in the needed parts of hidd to include with my app...)
Many thanks for any help,
Tom
Hi pyro777,
I was wondering if you received any replies on your query?
I also have a similar problem -- my android app accesses Dbus via a JNI, but I am getting the same permissions problem. I can use your workaround of explicitly setting the permissions on /dev/socket/dbus, but that solution can't be used for production code.
My Android java app as BLUETOOTH permissions, but this doesn't appear to be applied across the JNI boundary (as my experience indicates) into the JNI c++ library (*.so).
Does anyone have more info on this issue?
Thanks in advance,
robin
Hi evodevo,
No, no such luck so far if you figure it out I'd be happy to hear.
Strange, if this fails how does the normal Bluetooth java API it?
Perhaps certain permissions need to be set on your app? BLUETOOTH_ADMIN or so?
question 4 u: which libraries do you include when doing dbus stuff I get undefined references the whole time?

Reading GPS data from Android Phone on PC

I want to be able to read the current state of my GPS from my Android phone to my PC. I want to do it programmatically on the PC itself.
Currently, I am able to do it using telnet on my PC and an app called GPS tether on the phone. But, I want to read data off my phone without any software running on it. Also, I want to write my own codes. Is it possible and if yes, can you please provide me with some developer resources?
I plan to integrate this feature with the .NET framework using C#.

[Q] Android questions

I'm new to Android and have a few question that didn't get answered by trying to Google it. I have bought my first Android phone (A Samsung Galaxy S2, after years of being a Symbian fanboy), but have not received it yet.
1. Does everything run on top of Dalvik JVM? At the bottom is the Linux kernel. Then there is a Linux process which runs Dalvik VM. Could for instance Sun's JVM run on a Linux process of its own or another Linux application?
2. Can C/C++ Linux program run on Android? Though compiled for ARM. Android has NDK (Native Development Kit) which allows it to run C/C++ applications inside Android applications, but I'm wondering about running C/C++ applications directly on Android. BusyBox is coded in C, but runs on Android. Is it running directly on the kernel's linux process or within an Android application on Dalvik?
3. The latter(Q2) would indicate that not everything run on top of Dalvik. Otherwise C/C++ programs would not run.
4. Android uses ADB (Android Debug Bridge) for its CLI magic. BusyBox uses Ash. Can one install bash as the default shell, with full GNU Core Utilities commands? Some forum posts indicate that it is possible to install an ARM re-compiled bash version.
5. Android can be rooted by installing applications like Super User or BusyBox that would let the user execute applications as root. That would indicate that there exist a root user, in addition to the actual user. Is this similar to how it is on Linux? Can I define a password for the root user so that no applications can run root directly?
Edit: Seems each application is a different user on the system.
6. Are all user data stored in the database SQLite that are stored on the phone? User data is accessible through different applications, but how does Android determine access rights to it?
7. I have read that Android applications run on their own Linux process and are assigned a unique user ID. Does this mean that we can run ps to see all running processes or does it act like the Sun JVM just showing each VM process? However looks like different applications can run in the same process. Can these be distinguished or do we just the the once process.
8, Is the camera application (that some have made modifications of) a Google app or Samsung app? Just wondering since the former would allow such modified versions to run on other than Samsung phones, but given that different phones have different camera specs I don't see how this could go well.
9. Can the codes typed in the dialer be executed through a shell instead (adb)?
10. Can I get an overview of permissions given to applications? Can they be revoked after once granted?
i have question,too.thanks
Ill Be back with most of your answers. Im on my phone. Ill be at a comp in few.
Sent from my Incredible using Tapatalk
I'm also wondering about how the methods of rooting works.
Some offers rooting by means of a modified kernel.
Another method entails using programs like SuperOneClick or GingerBreak.
Can anyone describe to me what exactly does these methods do?
In order to have root I guess the user root needs to be created/activated/enabled on the phone. Also programs like su and Superuser needs to be installed, perhaps with Busybox.
Those are the methods for root, but I want to know what needs to be done on the phone in order to root it.
Can I root my device (Samsung Galaxy S2) manually without any modified kernels or special programs?
DJViking said:
10. Can I get an overview of permissions given to applications? Can they be revoked after once granted?
Click to expand...
Click to collapse
You can see the permissions an app has through Settings->Apps->Manage Apps i think. There are also apps on the market summarising that.
Revoking or granting only certain permissions is not available natively.
I believe they are working on that in cyanogenmod.
Revoking a needed permission will usually make the app in question crash.
DJViking said:
8, Is the camera application (that some have made modifications of) a Google app or Samsung app? Just wondering since the former would allow such modified versions to run on other than Samsung phones, but given that different phones have different camera specs I don't see how this could go well.
Click to expand...
Click to collapse
If you have a samsung device, the camera app will be from samsung.
It is not impossible to have the google camera app running on your device, it might need some tinkering though (see cyanogenmod).
DJViking said:
7. I have read that Android applications run on their own Linux process and are assigned a unique user ID. Does this mean that we can run ps to see all running processes or does it act like the Sun JVM just showing each VM process? However looks like different applications can run in the same process. Can these be distinguished or do we just the the once process.
Click to expand...
Click to collapse
Yes you can, here is the about from running "ps" on my i9000 : http://pastie.org/2089555
Only apps from the same developer ( meaning signed with the same signature), can be run in the same process. This is not default and only happens when the developer requests it. This is not very common.
DJViking said:
6. Are all user data stored in the database SQLite that are stored on the phone? User data is accessible through different applications, but how does Android determine access rights to it?
Click to expand...
Click to collapse
Through the android permission system.
PHP:
<uses-permission android:name="android.permission.READ_SMS"></uses-permission>
<uses-permission android:name="android.permission.WRITE_SMS"></uses-permission>
will be needed to read and write from/to the sms database.

Lock screen Programatically in Windows RT

Dear Team
I am developing an application for Windows RT device. I have a requirement to programmatically lock
the device screen. I tried to log off with a solution posted in this link
to open the "cmd" prompt, but the cmd prompt executes within the sandbox of winrt and hence "shutdown /l" failed to execute due to
access denied(5).It is mentioned in the forum to give "ALL APPLICATION PACKAGES" => FULL CONTROL. But in vain. Therefore I need solution either to lock the screen or open cmd prompt with required access.
with thanks
Sathia
Is this for a Win32 application that is compiled for ARM, or for a Windows Store application?
Windows Store applications don't have access to those APIs, which means anything that you run, runs in the same sandbox, and also doesn't have access (as you've noticed).
The only way to work around I think is to provide a separate lock screen inside your application. But it of course depends a bit on how you want to use it. If the goal is just to lock access to info in the app, that will work fine, but if you really need to lock the entire device, then I don't know...
solice13 said:
Is this for a Win32 application that is compiled for ARM, or for a Windows Store application?
Windows Store applications don't have access to those APIs, which means anything that you run, runs in the same sandbox, and also doesn't have access (as you've noticed).
The only way to work around I think is to provide a separate lock screen inside your application. But it of course depends a bit on how you want to use it. If the goal is just to lock access to info in the app, that will work fine, but if you really need to lock the entire device, then I don't know...
Click to expand...
Click to collapse
Hi thanks for your reply. Yes I need to lock the entire device using code(c#).Please share knowledge.

[Q] Debian chroot on phone/networking issue

Hello XDA Developers, I have a Debian subsystem of sorts on my phone which is created by an application called Lil' Debi. For those of you unfamiliar with it, it essentially creates a Debian install on an .iso that can be mounted onto the disk. Once mounted, a user can access a shell to interact with this Debian subsystem by running /debian/shell as root, which will chroot to its own directory system separate system accessible from the Android Terminal.
Within this Debian subsystem I have created a non-root user account for the purpose of running a few networking applications that if compromised for some reason, won't give the attacker root privileges to break everything on my phone. There's only one small problem with this setup: I can't access the internet from a non-root account.
Both my terminal emulator and Lil' Debi have full network access, even when not run as root. I am curious then, why a non-root user account should have an incapability of accessing the network. A sample of wget on my phone using Google's IP address (I use the IP address because it cannot do DNS lookup obviously) gives a Permission Denied error. At the current moment I am not sure whether this problem lies with Android or with Debian. Does the user need to be explicitly granted permissions to use the network through Debian, or is the application somehow only able to access the network if it's root?
Additional information: The ROM used is PAC ROM, so you can assume any settings changes that could be made from Cyanogenmod or Paranoid Android can be made if necessary. The phone itself is a Oneplus One. No I don't have invites, so don't bother asking.
Opinions on the matter?
Also, on an unrelated note, g++ will only run under root. If I launch it as a non-root user, it will tell me that execvp failed because cc1plus doesn't exist. Why?
Thread's fallen onto the third page, so I'm going to bump.
One day has passed, and no help offered. Bump again.
Another bump. I thought XDA was supposed to be the most knowledgeable forum on Android.
Daily bump until this problem is solved...
Still bumping...
I hope people aren't just looking at the number of replies and assuming it's resolved...
Bumping again. At least 100 people have seen this thread, and not a single one has anything to say.
Bump again. It's now been a week since I asked this question.
Bump.

Categories

Resources