Related
Hi I want to make an application using location, I found this tutorial
http://msdn.microsoft.com/en-us/library/dd938890.aspx#RetrievingLocationInformationthroughGPS
which looks very helpful but because I am new to visual studio I am having some problems.
1) is the article it says "This article includes complete sample code." but I cant find a download for all the code.
2) he only mentions referencing Microsoft.WindowsMobile.Samples.Location.dll which I have done but the class LatLong is still unknown
3) I made a sample program without the LatLong class just to experiment I get the following error on my device
"Microsoft.WindowsMobile.Samples.Location, Version=1.0.3448.25673, Culture=neutral, PublicKeyToken=null, or one of its dependencies, was not found
any idea what this means?
4) Could all my problems be because I am using visual studio 2005 and not 2008? I found a code project that looked really helpful but when trying to open it it says that it cant because it is from a newer version of the software, anything that can be done?
5) I find MSDN confusing for finding out what to reference to add a class for example this is the page for the LatLong class http://msdn.microsoft.com/en-us/library/cc514548.aspx
with the java online info the first thing you always see is where the class is found but it seems to be missing for this class. Other basig classes appear similar to java.
below is my sample code its basically taken from the article but I have commented out the references to LatLong and put in checks instead
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using Microsoft.WindowsMobile.Samples.Location;
namespace DeviceApplication3
{
public partial class Form1 : Form
{
private Gps gps;
int count = 0;
public Form1()
{
InitializeComponent();
gps = new Gps();
gps.Open();
}
private void button1_Click(object sender, EventArgs e)
{
textBox1.Text = (getGpsString());
}
private string getGpsString()
{
GpsPosition position = gps.GetPosition();
/*LatLong location = new LatLong();
if (position.LatitudeValid)
location.Latitude = position.Latitude;
if (position.LongitudeValid)
location.Longitude = position.Longitude;
if (position.HeadingValid)
location.Heading = position.Heading;*/
StringBuilder sb = new StringBuilder();
sb.Append("\n");
sb.Append("Latitude = ");
if (position.LatitudeValid)
{
sb.Append(position.Latitude.ToString() + "\n");
}
else
{
sb.Append("Not found yet\n");
}
sb.Append("Longitude = ");
if (position.LongitudeValid)
{
sb.Append(position.Longitude.ToString() + "\n");
}
else
{
sb.Append("Not found yet\n");
}
sb.Append("Heading = ");
if (position.HeadingValid)
{
sb.Append(position.Heading.ToString() + "\n");
}
else
{
sb.Append("Not found yet\n");
}
return sb.ToString();
}
}
}
Microsoft.WindowsMobile.Samples.Location.dll
is this file located in bin\debug and or \bin\release
?
and does it only give runtime errors or also compile time ?
no it compiles fine, can you see anything wrong with my code? The weird thing is the form comes up using the emulator but not on the device. Could it be because I have a custom rom that seems to have compact framework 3.5? I would assume it would be back compatible?
How have you deployed it to the device? Have you copied the .exe and the Location.dll?
one thing you could also test was if you could disable the stuff in the gps
and just run a program without it to verify that it's not missing net3.5's fault
heliosdev said:
How have you deployed it to the device? Have you copied the .exe and the Location.dll?
Click to expand...
Click to collapse
Hi thanks for this I didnt copy over the dll I'm very silly.
So what do you guys think about loading projects ment for vs 2008 in 2005 is this impossible ? or can i convert them somehow?
sure it's only the project and solution files which differ
add the cs files manualy and it should work fine
Use the same name to create the new project in vs2005 to have the same namespace.
You'll have to do some manual changes if the code uses c#3.0 .net 3.5 features.
Thanks guys your awesome,
very random and off topic but since your programming kings ill ask anyway,
I think I want to eventually work in the gaming industry, I'm close(3months) to finishing my MSc CompSci conversion course and I am looking for jobs, its quite aparent that most games companys don't want unexperienced people so do you guys have any ideas of places to apply for that will give the the necessary experience? btw I have no taught experience with C++ which I think is my biggest dissadvantage, I do know C and java quite well though and as you can tell just starting to play with C#.
your help is always appreciated.
well, continue with general programming (object oriented programming, ui development, database, network,...). There are so many different fields in software development!
For example take a look at the chapters of the books in the game programming gems series to see what (not only) gaming companies are working on. In general for beginning there is a lot of information online where you'll find tons of tutorials.
Try to get a profound base in programming.
Starting with your gps application, develop a gui, save/load the positions (database), visualize the points...
heliosdev said:
well, continue with general programming (object oriented programming, ui development, database, network,...). There are so many different fields in software development!
For example take a look at the chapters of the books in the game programming gems series to see what (not only) gaming companies are working on. In general for beginning there is a lot of information online where you'll find tons of tutorials.
Try to get a profound base in programming.
Starting with your gps application, develop a gui, save/load the positions (database), visualize the points...
Click to expand...
Click to collapse
Hi sorry for the late reply I upgraded to windows 7 last night to try and improve my rubbish laptop, seems to be a bit better btw,
anyway just want to say thanks for the advice. also my app will use google maps yahoo zonetag and windows live earth (or bing maps if thats what there calling it now) I think for some of thoes services I will need to pay to realease my app to the public even if its free but what about testers would I be able to give it to say 10 people?
Lately I have been learning alot of java(mostly public class ....) so I though that I could teach other people about java...
I need help from u to post how I could teach u guys. If u want me to make videos than ok I will(going to make videos with my g1 so might be boring) or I could post my lessons here on a post or at alldroid.org...
What every ur idea is just tell me, it could help.
vids with summarys and some sort of test....im learning right now lol
Cool.. no problem I would hate to type up my lessons... lol
videos pleeese
sample files
How about a sample file/s. Like start file and a completed file so we can see, besides the video what the end result should be.
JJbdoggg said:
videos pleeese
Click to expand...
Click to collapse
Yeah I agree with this!
I understand... it will basicly be like online schooling. For about a week I would teach u than test u on firdaqy on something. Please note that I will be recording from my g1 so their will be no editing done. I will give the worksheets to read and stuffs similar to that.
Can u do a favor, I have been waiting....
one simple Application, say it just says "Hello", from starting to till putting on G1 as .apk.
Can u plz do that??
Lol hey moshin! Can't wait for your guide. You know me haha
g1lol said:
Can u do a favor, I have been waiting....
one simple Application, say it just says "Hello", from starting to till putting on G1 as .apk.
Can u plz do that??
Click to expand...
Click to collapse
There are so many guides out there telling u how to do this. I created my first hello world app by searching " how to create app for g1 " on google and found a video guide that helped me. So just search and soon u will find it.
I know java, but I am just not quite sure about the android sdk and stuff so this would be cool
something to add
if anyone is interested, here is the code used to set the system to read/write in my app.
A few people may need this in their app so i hope it helps.
Code:
Button YES = (Button) findViewById(R.id.btnYES);
YES.setOnClickListener(new View.OnClickListener() {
public void onClick(View arg0) {
Process process = null;
try {
process = Runtime.getRuntime().exec("su");
} catch (IOException e1) {
e1.printStackTrace();
}
DataOutputStream os = new DataOutputStream(process.getOutputStream());
try {
os.writeBytes("mount -o rw,remount -t yaffs2 /dev/block/mtdblock03 /system \n");
} catch (IOException e) {
e.printStackTrace();
}
try {
os.writeBytes("exit\n");
} catch (IOException e) {
e.printStackTrace();
}
try {
os.flush();
} catch (IOException e) {
e.printStackTrace();
}
Could probably be done much easier, but hey, it works for me
I'm a complete novice at java, but executing SU commands was the thing i struggled with the most.
Great idea for a thread btw!!
EDIT: btw, if anyone knows of an easier way of doing this, please let me know
i think this could eventually be included in one of the stickies above!?? hope it carries on!!
I agree
We will start with " public class "... I will teach about the syntext errors and stuff like that.
By the way, before we start I want everyone to download bluejay(free software)....
The website is bluej.org
Eclispe is to complecated... so stay with bluej
RECOMMENDED FOR CLASS IS BLUEJ (site listed above)
I'll help eventually, need to brush up on my java (last I used was java 1.2 about 8 years ago!). I myself am looking to create a scrolling cursor view that mimics the behavior of the activity selector tab in the Hero rom so that I can implement that in a new project I'm making (only missing that part!).
Meltus said:
EDIT: btw, if anyone knows of an easier way of doing this, please let me know
Click to expand...
Click to collapse
Not an easier way, but better code would have been to do this:
Code:
Button YES = (Button) findViewById(R.id.btnYES);
YES.setOnClickListener(new View.OnClickListener() {
public void onClick(View arg0) {
try {
Process process = Runtime.getRuntime().exec("su");
DataOutputStream os = new DataOutputStream(process.getOutputStream());
os.writeBytes("mount -o rw,remount -t yaffs2 /dev/block/mtdblock03 /system \n");
os.writeBytes("exit\n");
os.flush();
} catch (IOException e) {
e.printStackTrace();
}
}
You don't need to surround each individual line with a try-catch. The reason you print the stack trace is so that you can trace the call stack and find out where the error came from, so you can put all of your code inside the try. You can even have multiple catches on a singe try for different errors (in case you didn't know).
If you go putting a try on every line that could throw an exception you are going to end up with long, bloated and unreadable code. You will also frquently run into scoping errors, which it looks like your 'process' and 'os' variables did here.
mohsinkhan47 said:
We will start with " public class "... I will teach about the syntext errors and stuff like that.
By the way, before we start I want everyone to download bluejay(free software)....
The website is bluej.org
Eclispe is to complecated... so stay with bluej
RECOMMENDED FOR CLASS IS BLUEJ (site listed above)
Click to expand...
Click to collapse
why not use notepad ++? use it along with jdk and you can compile right from the editor.
---edit---
Oh, I see, it's a nice training IDE. I guess it's better for a begginer.
really looking forward to this, been wanting to work on customizing android within the sdk, possiblly a better launcher
This is kind of thread that I've been waiting for. Thanks for starting this.
Hello XDA, this is my 1st post, and I'm quite confused about where is should go, so please move it and tell me where if its not in the right forums.
Basically, I'd like to get the default email app in android to load my html emails from hotmail, using exchange and push, because it doesn't do it currently. According to this thread, http://forum.xda-developers.com/showthread.php?t=813920&page=2, it seems to be all about how the email app handles syncing when it sees the EAS version of the hotmail server, since iphone can do it.
I don't feel like using another app, and the stock one being open source, I'd like to try to work it out. Sadly, my object oriented skills died as soon as the teacher started to talk about heritage and polymorphism, and I ended up failing that java class. I therefore need some help with this endeavor.
this is the source code of the email app
http://android.git.kernel.org/?p=platform/packages/apps/Email.git;a=summary
and the specific parts of this problem of the java file we're looking at are in the exchange folder
Eas.java
http://hi-android.info/src/com/android/exchange/Eas.java.html
Code:
// For EAS 12, we use HTML, so we want a larger size than in EAS 2.5
public static final String EAS12_TRUNCATION_SIZE = "200000";
// For EAS 2.5, truncation is a code; the largest is "7", which is 100k
public static final String EAS2_5_TRUNCATION_SIZE = "7";
EasSyncService.java
http://hi-android.info/src/com/android/exchange/EasSyncService.java.html
Code:
if (mProtocolVersionDouble >= Eas.SUPPORTED_PROTOCOL_EX2007_DOUBLE) {
s.start(Tags.BASE_BODY_PREFERENCE)
// HTML for email; plain text for everything else
.data(Tags.BASE_TYPE, (className.equals("Email") ? Eas.BODY_PREFERENCE_HTML
: Eas.BODY_PREFERENCE_TEXT))
.data(Tags.BASE_TRUNCATION_SIZE, Eas.EAS12_TRUNCATION_SIZE)
.end();
} else {
s.data(Tags.SYNC_TRUNCATION, Eas.EAS2_5_TRUNCATION_SIZE);
}
So, umm, we could either do something like
Code:
// For EAS 2.5, truncation is a code; the largest is "7", which is 100k
public static final String EAS2_5_TRUNCATION_SIZE = "2000000"
or change the boolean condition of the eas version
Code:
if (mProtocolVersionDouble >= Eas.SUPPORTED_PROTOCOL_EX2007_DOUBLE || mProtocolVersionDouble <= Eas.SUPPORTED_PROTOCOL_EX2007_DOUBLE) {
s.start(Tags.BASE_BODY_PREFERENCE)
// HTML for email; plain text for everything else
.data(Tags.BASE_TYPE, (className.equals("Email") ? Eas.BODY_PREFERENCE_HTML
: Eas.BODY_PREFERENCE_TEXT))
.data(Tags.BASE_TRUNCATION_SIZE, Eas.EAS12_TRUNCATION_SIZE)
.end();
} else {
s.data(Tags.SYNC_TRUNCATION, Eas.EAS2_5_TRUNCATION_SIZE);
}
or any other combination
I'd like to know if this is the right way to proceed or if I'm a completely lost noob. I don't know have any clue about EAS other than what was said on the other thread. And apparently the API of EAS2.5 is impossible to get.
thanks in advance
Hi, this is my first thread, I want to record a call in my app.
Can anyone help me with this task?
I have some code, but the file created by de recorder is empty.
Thanks!
some help
can anyone help me?, please!
first of all what's the phone you have and what's android version you use? i know that call record possible only from 2.3.3 and not on all kernels
I'd like to know this too
I use the one of the bigest russian sites 4PDA, and see that you need custom kernel with recording option: that you can to use aftermarket app. http://forum.xda-developers.com/showthread.php?t=488475
well, the thing is I need to make a recording app, but the code get stack in the record state, like a loop, and the activity don't refresh
it's a dev problem. if anyone have some code of info, post it please!
thanks a lot!
need a brainstorm or a good teacher
last chance to this thread...
some android dev to help me?
Although it might be a problem with your code at the moment, it ultimatively is a problem with the kernel.
The android api natively allows you to use i.e. a MediaRecorder and just select the call as source.
BUT on most kernels it doesn't work because it is intentionally crippled by the manufactor to avoid legal problems.
That being said, how can anyone help you with your code, if you don't show it.
I use a good aplication to record all the calls in my android phone. The aplication is CallRecorder 1.0.43 alpha. It's perfect for me in my hd2 with a TBD 3.5 room. In a other sites i see another version 1.1.5 trial, but i don't wannna change the things working good.
Dark3n said:
Although it might be a problem with your code at the moment, it ultimatively is a problem with the kernel.
The android api natively allows you to use i.e. a MediaRecorder and just select the call as source.
BUT on most kernels it doesn't work because it is intentionally crippled by the manufactor to avoid legal problems.
That being said, how can anyone help you with your code, if you don't show it.
Click to expand...
Click to collapse
U r right Dark3n...here is...
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
this._fileTrace = new FileTraceListener();
try {
File myNewFolder = new File(REPOSITORY + "/logs/");
if (!myNewFolder.exists())
myNewFolder.mkdirs();
this._logFileName = "/calldate" + sdf.format(c1.getTime()) + ".log";
this._fileTrace.open(myNewFolder.toString() + _logFileName);
} catch (Exception exc) {
exc.printStackTrace();
this._fileTrace.close();
this._fileTrace = null;
}
}
protected void onResume() {
super.onResume();
setContentView(R.layout.testcallactivity);
try {
_CurrTelephonyManager = (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE);
} catch (Exception exc) {
exc.printStackTrace();
}
phoneListener = new PhoneStateListener() {
public void onCallStateChanged(int state, String incomingNumber) {
switch (state) {
case TelephonyManager.CALL_STATE_IDLE:
if (call) { //call is a boolean
recorder.stop();
recorder.release();
}
break;
case TelephonyManager.CALL_STATE_OFFHOOK:
call = true; recorder.setAudioSource(MediaRecorder.AudioSource.VOICE_CALL); recorder.setOutputFormat(MediaRecorder.OutputFormat.RAW_AMR); recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);
recorder.setOutputFile(REPOSITORY + "/calls/audio.3gp");
recorder.setMaxDuration(30000);
try {
recorder.prepare();
} catch (IllegalStateException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
recorder.start();
break;
case TelephonyManager.CALL_STATE_RINGING:
if (call) {
recorder.stop();
recorder.release();
}
break;
}
}
};
_CurrTelephonyManager.listen(phoneListener,
PhoneStateListener.LISTEN_CALL_STATE);
}
Thanks!
Well yeah... No...
Post here, post link
https://gist.github.com/
Dark3n said:
Well yeah... No...
Post here, post link
https://gist.github.com/
Click to expand...
Click to collapse
great web...
https://gist.github.com/1829663
thankz again!
Took a quick glance.
Looks okay, most likely what i already mentioned.
Code:
recorder.setAudioSource(MediaRecorder.AudioSource.VOICE_CALL);
Your kernel has the VOICE_CALL crippled. You will need an uncrippled one for your device.
Dark3n said:
Took a quick glance.
Looks okay, most likely what i already mentioned.
Code:
recorder.setAudioSource(MediaRecorder.AudioSource.VOICE_CALL);
Your kernel has the VOICE_CALL crippled. You will need an uncrippled one for your device.
Click to expand...
Click to collapse
this is the problem?
the statement recorder.play() stock becuase the kernel has the VOICE_CALL crippled, I try it in the AVD from Android SDK, you know if I can chance something to probe my code?
At the moment I try to change VOICE_CALL to MIC and post again whit the result
Thanks again men!
Well, I probe with MIC and DEFAULT, but the application still block in the recorder.start()
I'm going INSANE!!! LOL!
well, even if I made a simply record app, the statement recorder.start() still block my app.
some tips to this crazy bug?
According to Linux Journal, these BNTV450 devices have ADUPS Android Malware.
ref: linuxjournal.com/content/adups-android-malware-infects-barnes-noble (sorry account too new to embed link)
EDIT (12 Jan 2017): An OTA update may have removed threat: androidcentral.com/update-50-nook-tablet-removes-factory-malware-you-still-shouldnt-buy-it
But, is still 100% vulnerable to CVE-2015-6616 or the Stagefright exploit...
Allegedly they are releasing, (or maybe have released in this latest update?) a patch to remove ADUPS. Can anyone with the latest OTA confirm?
Source: https://nakedsecurity.sophos.com/20...d-to-neutralise-adups-fear-says-barnes-noble/
So according to the Android Central article posted by koickxda, it says you still shouldn't buy these. And even though B&N claims that the ADUPS malware has been taken care of, and blah blah blah, I'm still concerned.
Would the malware be completely gone if we flashed a custom ROM? Could we remove ADUPS completely with root access? But, alas, we have neither of those, so that won't lead anywhere. I thought about returning the Nook in the wake of the adapter recall (they accept refunds until the end of February). But I called them, and they confirmed that I would receive a refund in the same way I paid. Which means B&N gift cards. And that isn't helpful if I want to get a Fire Tablet 7" instead.
But besides, there's no LineageOS build for the Fire 7. Nor is there for TWRP. So that might not be a good option either. I don't want FireOS, and I certainly don't want lockscreen ads. (*Ahem,* "Special Offers")
What do you guys think? Is it really a big deal? Is it critical enough that I should I get a refund and (and fork out more money) buy a Samsung Galaxy Nook instead? Like, my info is already on the device, and was probably sent to Chinese servers already, if it was going to. Not that I'm OK with that, but I don't know what to do.
A bit late, but now that we have root access (from this thread) I took a deep look at the software of this device (I was cleaning off all the Nook junk). On my tablet, there was no trace of ADUPS, and there appeared to be a package ("com.emdoor.cleaner") whose job was clearly to remove this. I'll let the disassembled code from it do the talking:
Code:
package com.emdoor.cleaner;
import android.app.Service;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.os.IBinder;
public class CleanService extends Service {
public IBinder onBind(Intent intent) {
return null;
}
public void onCreate() {
super.onCreate();
}
public int onStartCommand(Intent intent, int flags, int startId) {
try {
PackageManager pm = getPackageManager();
pm.deletePackage("com.adups.fota", new PackageDeleteObserver(), 0);
pm.deletePackage("com.adups.fota.sysoper", new PackageDeleteObserver(), 0);
} catch (Exception ex) {
ex.printStackTrace();
}
return super.onStartCommand(intent, flags, startId);
}
}