Architectural advice needed for Android to from PC communication - Design, Prototyping, UI, Graphics

Hello there . I'm a bit in doubt as to what approach I should take when creating an application which should accomplish the following: use the USB connection between the device and the Windows-PC to display on the device's screen some information sent by an application residing on the PC. The phone should always operate in airplane mode but Android Debug Bridge works fine on it.
What I'd like to do is to write a Java Application (running on Windows) which reads from a text file and puts that information on the Android device's screen, but I don't know if there are any libraries I can use in a JDK application to achieve this.
Also, I'm not even sure if using ADB is the best option. Perhaps I could initiate communication via USB in a different way?
Please share with me your architectural advice. I would REALLY appreciate some examples or open source projects which achieve similar things. I'm a senior developer but I have very little experience with Java or Android (my background is C#/C++/ECMAScript).

Related

[Q] [PROJECT] Control network tasks via scripts

ok first of all i'm new to the linux scene but have made my first steps with some embedded devices here within my home network.
now what i would like to do is: i'd love to write some sort of application/collection of scripts to remotely perform common tasks that come up during my everyday life, and maybe even extend the collection to be a versatile tool for all sorts of linux related terminal commands and shell scripts.
the first thing i wanted is to get my desire to connect to my NAS (mybook world edition white light) via ssh and automatically perform certain task so that i don't have to do it by hand. sure connectbot and other ssh clients work just fine for these tasks, but i thought: wouldnt it be nice if that whole process had a GUI.
i'm talking about tasks like reboot the NAS, restart or stop sabnzbd (usenet nzb grabber) and things like that, maybe even remotely start my htpc (ubuntu with xbmc).
now my question is, is there a command in busybox or even standart android linux which lets me connect to an ssh server and perform certain tasks, without having to type in username and password and the command itself?
thx in advance
the linux newbie uuzi
1) Wrong section...
2) Market: ServerAssistent
market: Tasker ?

[Windows Phone Utility]Rapi Communications

Program to communicate between the PC <-> Device WP7.The application supporting the connection to the device.
It works on the principle of RAPI communications. He pulled out of the Zune Program
Info:
Description of the product: Windows Phone RAPI Communication Service EXE
Product Name: Zune
Product Version: 4.7.109
Usage:
Waiting....
Files in Attachmend
How to Use?Demo?
Is there any way to access phone without Zune drivers or Zune software installed using this application? Clicking on the EXE doesn't do anything.
thesecondsfade said:
Is there any way to access phone without Zune drivers or Zune software installed using this application? Clicking on the EXE doesn't do anything.
Click to expand...
Click to collapse
have any idea what the communication RAPI?
See this: RAPI in MS
Nokser said:
have any idea what the communication RAPI?
See this: RAPI in MS
Click to expand...
Click to collapse
But how does this package fit into that? This looks like perhaps a way to get native debugging working, but I don't see what to do with this.
You haven't provided any information about what it does--the program just quits regardless of zune state or WP-device connected state. What does it do? Through what means is someone to interact with it? I don't know too much about how RAPI worked on Windows Mobile, but there isn't any indication of how to use /this/ in the article you linked.
davux said:
But how does this package fit into that? This looks like perhaps a way to get native debugging working, but I don't see what to do with this.
You haven't provided any information about what it does--the program just quits regardless of zune state or WP-device connected state. What does it do? Through what means is someone to interact with it? I don't know too much about how RAPI worked on Windows Mobile, but there isn't any indication of how to use /this/ in the article you linked.
Click to expand...
Click to collapse
I give to more info... but not now my friend
[This is a reverse engineering effort in progress. Your mileage may vary and information below could be completely inaccurate. Proceed at your own risk.]
It's a Windows service. Copy it somewhere handy, and issue the command (editing the path as necessary). NOTE: The spaces are required.
Sadly, I don't recall retail phones having RAPI bits, so doubt this will be useful. I'll have another look at the filesystem though.
Update: Judging by the way this executable behaves, it's likely meant to replace WMZuneComm.exe.
Update 2: Because of the reliance on Zune libraries (e.g. ZuneSA.dll), this is for 32-bit Zune users.
Update 3: Listens on localhost, port 64694
These are old binaries from old Zune client software. Retail devices don't have RAPI bits (verified via samsung ffus), therefore this is useless. Silly original poster.
WithinRafael said:
[This is a reverse engineering effort in progress. Your mileage may vary and information below could be completely inaccurate. Proceed at your own risk.]
It's a Windows service. Copy it somewhere handy, and issue the command (editing the path as necessary). NOTE: The spaces are required.
Sadly, I don't recall retail phones having RAPI bits, so doubt this will be useful. I'll have another look at the filesystem though.
Update: Judging by the way this executable behaves, it's likely meant to replace WMZuneComm.exe.
Update 2: Because of the reliance on Zune libraries (e.g. ZuneSA.dll), this is for 32-bit Zune users.
Update 3: Listens on localhost, port 64694
These are old binaries from old Zune client software. Retail devices don't have RAPI bits (verified via samsung ffus), therefore this is useless. Silly original poster.
Click to expand...
Click to collapse
You do not have right to end because of ... Each distributed system WP7, has the shell RAPI applications and libraries.
You can't just dust off old Zune files from 2009 and magically connect this to a phone. Get real.

WP7 Unlocking, Sideloading etc. Problems and Solutions

Now, I know no-one actually likes reading threads, and would prefer to just post a new question at the end (I'm guessing partly because the threads are so long, but that's because everyone is doing it) so I'm going to try and give solutions to as many of the issues with ChevronWP7, sideloading and anything else that's not quite working.
Note, none of this is to facilitate any kind of software pirating (we will notice if it gets discussed, and it's in the forum rules - and kinda immoral).
Firstly, Windows Vista (I think SP2) or Windows 7 is required, this won't work on XP without a few hacks/tweaks, and it's not worth me writing the whole process out, plus I don't have an XP machine to hand, so I can't try things.
The most common issues can be fixed with just installing the correct software.
You NEED to have the official WP7 Developer Tools installed, they're a free download from Microsoft, and if you're planning on doing development (which is after all part of the reason for wanting sideloading) you kind of need them.
There's a guide on how to install them (provided by Microsoft) here. You only need the basic toolset from here, but installing the October update won't cause any issues.
This should solve the following exception:
Code:
System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.SmartDevice.Connectivity, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
as well as a few other issues.
When running any of the tools, if you encounter issues, try either running the tool as an administrator or turn of UAC (for both, do a search if you've no idea what I'm on about), this may solve some issues with access rights etc.
Once you've got that installed, Chevron issues are in post #2, sideloading XAPs in #3.
ChevronWP7 Issues
With Chevron, most things are explained well in the opening post of this thread. Read it.
Chevron works by tricking your phone into thinking it's communicating with Microsoft servers, when it's actually just communicating with Chevron, this means certain web based activities may interfere (Skype for example).
The best way of finding out what's going on, is to use the following guide, it should work, if that fails, then post a question.
sushovande said:
Okay so here is *everything* I did to succeed in re-unlocking my Samsung Focus
1. Have Winphone developer tools installed
2. Connect Phone via USB
3. Wait till zune starts and sync completes
4. Verify that zune is not in a guest relationship
5. open a command prompt, type netstat -a to confirm that port 443 is not being used
6. open an admin command prompt, navigate to c:\windows\system32\drivers\etc\ then type notepad hosts and delete any references to windowsphone developer services
7. go to the settings on the phone and turn airplane mode on (so that the phone is forced to use internet via zune)
8. While the phone is still on the settings page, run Chevron with admin privileges
And it worked!
Click to expand...
Click to collapse
There's no way to know whether a device is unlocked or not until you come to sideloading, which is the point where it matters anyway. Nothing (visible) will change on the device, so don't bother looking for any changes.
WP7 devices occasionally phone home (as far as I know they only do so when connected with Zune) to check whether they should be unlocked or not. If not, they quietly re-lock themselves, and non-marketplace apps will say something along the lines of "This application has been revoked". You'll need to try unlocking again with Chevron and possibly reinstall the apps. There's not much that can be done other than legitimately unlocking your devices.
There's a sideload limit of 10 applications, though there's a version of Chevron that has this limit hacked out of it, I just can't remember where it is. For most legitimate uses, this limit should be fine (and is better than the student/DreamSpark limit of 3).
XAP Installation
A first port of call if Toms XAP Installer doesn't work is to use the official one. It does work.
If you've installed the Developer Tools linked to in the first post, you'll have it already, and should be able to sideload, if your device has been unlocked. If it hasn't you'll have issues, and you should take a look at post #2 in this thread.

Experienced Developer, new to mobile hacking, where to start?

I have experience as a .net developer, a SQL developer, and a network administrator, but I've never done anything with mobile development. I'll be able to do some damage, but I need someone to point me in the right direction here.
I am not interested in messing with the existing windows CE os AT ALL, only Android. I motivated by this phone because it's the only modern phone who's ESN can be activated on verizion without a data plan.
SO, can an experienced person within the community give me a lay of the land of where I can contribute and get working?
my 2c: Most of the hacking i've done was on PSP, and they always loaded custom firmware by getting into the core / bios area, just like all of the other jailbreak methods. Can we do that?
Gaujo said:
I have experience as a .net developer, a SQL developer, and a network administrator, but I've never done anything with mobile development. I'll be able to do some damage, but I need someone to point me in the right direction here.
I am not interested in messing with the existing windows CE os AT ALL, only Android. I motivated by this phone because it's the only modern phone who's ESN can be activated on verizion without a data plan.
SO, can an experienced person within the community give me a lay of the land of where I can contribute and get working?
my 2c: Most of the hacking i've done was on PSP, and they always loaded custom firmware by getting into the core / bios area, just like all of the other jailbreak methods. Can we do that?
Click to expand...
Click to collapse
well, one major thing that you can help with, is getting drivers for the kin two, because the ones we have are only diag drivers, and do not let us see the phone in windows explorer...the diag drivers only let us see the filesystem in Bitpim.
welcome to the "i know kung-fu but this seems to need jiu-jitsu" group of developpers.
As noted above... drivers.. drivers drivers....
In the other threads you can see my hardware attempts resume about the usb access to the devices and explanation about why we didnt flashed anything yet (tldr; is shop-protected).
The only driver available for flashing (in windows) or linux direct access turned us into a nvflash executable being frozen, doing anything. For the other modes we have not data on how to operate with them.
On your request: yes, you could run android here, as tegra 2500 was made for wince and android (currently they work with froyo), so i guess we could do the move (i would want to backup Win CE anyway... just in case ... for messing around with flashing...).
johnkussack said:
welcome to the "i know kung-fu but this seems to need jiu-jitsu" group of developpers.
As noted above... drivers.. drivers drivers....
In the other threads you can see my hardware attempts resume about the usb access to the devices and explanation about why we didnt flashed anything yet (tldr; is shop-protected).
The only driver available for flashing (in windows) or linux direct access turned us into a nvflash executable being frozen, doing anything. For the other modes we have not data on how to operate with them.
On your request: yes, you could run android here, as tegra 2500 was made for wince and android (currently they work with froyo), so i guess we could do the move (i would want to backup Win CE anyway... just in case ... for messing around with flashing...).
Click to expand...
Click to collapse
I've never edited or created a driver, but if someone will point me in a specific driver, I will hammer away as best I can.
I don't understand what you mean here:
" The only driver available for flashing (in windows) or linux direct access turned us into a nvflash executable being frozen, doing anything. For the other modes we have not data on how to operate with them."​
Point 1) The APX mode (booting with USB keys + power) is what we called as flashing "part", which uses nvflash (.exe) as tool to do flashing to the devices.
The driver you can get from nvidia (that one exists) lets nvflash find the device but the kin seems to be writeprotected, so the tool outputs an error while connecting to the KIN. Also, further attemps make nvflash get stuck in the connection process forever (and ever).
Point 2) The other modes (normal or special keys hold) have no known drivers nor known-yet ways to get them. Of course, if i knew how to make one, i would have tried to make it myself, as i tried with the MPMz protocol on the kin, so can't point you in any direction there.
That's what i meant.

[Q] Native COM debugging

I have been experimenting with Native COM on WP7. I create a native COM project in Visual Studio 2008 and a managed project in Visual Studio 2010 which consumes the native COM DLL. Everything works great but debugging the native code is tricky. The managed debugger will not debug the native code. The native debugger in visual studio 2008 will not attach to the device. DEBUGMSG statements that I add in the native COM project do not show up in the debug output in the managed debugger.
Has anyone discovered any good tricks to assist with native COM debugging?
Unfortunally there is no way to connect debugger even to managed code.
I could live with there being no native debugging, if I could at least get some logging functionality. I guess I could log to a file in the native code and then read it out from the managed side, or I could set up a COM event and pass back strings to the managed side for debugging output. Seems like there might be an easier way?
If you've looked at the OEM code, (and I have), you'll know not even they have the ability to put the device into KITL mode and attach a debugger. Only the MSFT guys can.
The only way you're going to be able to do it is write to a log file in your \My Documents\ folder and read it back.
Thanks walshieau (your blog really helped me get started with this). I guess my other approach would be to debug the native code on a Windows CE device and then use the debugged native COM dll in WP7.
It's possible to cook in KITL on HD2 and connect the device to visual studio.
walshieau said:
If you've looked at the OEM code, (and I have), you'll know not even they have the ability to put the device into KITL mode and attach a debugger. Only the MSFT guys can.
The only way you're going to be able to do it is write to a log file in your \My Documents\ folder and read it back.
Click to expand...
Click to collapse
Laurentius26 said:
It's possible to cook in KITL on HD2 and connect the device to visual studio.
Click to expand...
Click to collapse
Yes it is possible to "cook-in" KITL for the HD2. But not for retail WP7 devices atm.
Back to the original question, I'd suggest downloading the WM 6.5 SDK and debugging it that way via the emulator.
Debugging on the Windows CE 6 emulator works great. I was able to make a simple console app that consumed my COM DLL and debug into the native code. I'm hoping that once the COM DLL is debugged, integrating it back into the WP7 app should be a breeze.

Categories

Resources