Page 1 of 1

Helloworld on android studio

Posted: Sat Oct 06, 2018 8:23 am
by brunoramos96
Hi everyone,
I'm a beginner in te area of programing in android, and it's my objective to use phidgets sensors in a Android's phone.
So I started by put my phidgets sensor collecting data for my android. I read the information in the phidget's site, and after downloading de examples that includes the HelloWord example I tried to import tht project like phidgets teaches. However, an error message appeared saying that the project that I chose contain non-ASCii characters.
I searched for a solution, and almost everyone said that the mklink /D "C:\android-sdk" "C:\Users\x user\AppData\Local\Android\Sdk" would solve my problem. But it isn't solved. I would like to Knbow if any of you know how to solve, or how to put an Hello World Example running on my Android.
Thank you

Re: Helloworld on android studio

Posted: Tue Oct 09, 2018 10:53 am
by jdecoux
I cannot replicate your non-ascii characters problem, so I will take this time to ensure you are importing the project from the correct folder.

After unzipping the example download, you may end up with a folder called "Phidget22_HelloWorld_Java_Android_Ex_########". This is not the project folder, you will want to import the folder inside that one, called "HelloWorld".

If you do that, importing the project should be straightforward. You may encounter a build error indicating you need to install different build tools, but the link in the error message installs them for you.

Re: Helloworld on android studio

Posted: Wed Oct 10, 2018 3:15 pm
by brunoramos96
jdecoux wrote:I cannot replicate your non-ascii characters problem, so I will take this time to ensure you are importing the project from the correct folder.

After unzipping the example download, you may end up with a folder called "Phidget22_HelloWorld_Java_Android_Ex_########". This is not the project folder, you will want to import the folder inside that one, called "HelloWorld".

If you do that, importing the project should be straightforward. You may encounter a build error indicating you need to install different build tools, but the link in the error message installs them for you.


Hi,

Thanks for the tip. I solved already my problem. Basicly the problem was in characters like "-" or "~", that were included in the nameof the folder. For now my problem is in programming in android studio.
I want to build a app that allows the user to measure the acceleration of a machine, using a sensor Phidget_1044. But I am a beginer in android and also java. I wanto to start just by running the example that phidgets give for that sensor por java-android, but it's not working.
Do you have any tip for me to start?

Best regards

Re: Helloworld on android studio

Posted: Wed Oct 10, 2018 3:46 pm
by jdecoux
What kind of problem are you having with the example, and which example are you using?

How is the Phidget connected to the Android device? Is it plugged in direct via USB, or over the network?

If you are trying to connect over the network, do you have a version of the Phidget Network Server running on the machine the Phidget is plugged into? And is your Android device connected to the same local network?

Re: Helloworld on android studio

Posted: Sat Oct 13, 2018 9:22 am
by brunoramos96
jdecoux wrote:What kind of problem are you having with the example, and which example are you using?

How is the Phidget connected to the Android device? Is it plugged in direct via USB, or over the network?

If you are trying to connect over the network, do you have a version of the Phidget Network Server running on the machine the Phidget is plugged into? And is your Android device connected to the same local network?


Tha example is this: https://www.phidgets.com/downloads/phid ... oid_Ex.zip

The error that appears on my android studio after trying to import the project related with the example above is this:
SDK location not found. Define location with sdk.dir in the local.properties file or with an ANDROID_HOME environment variable.

I'm trying to fix this but nothing is working...

Re: Helloworld on android studio

Posted: Mon Oct 15, 2018 10:57 am
by jdecoux
A quick search seems to indicate you need to create a file called local.properties in your project folder (called "Spatial" in the case of the Spatial example, unless you renamed it).

In that file you need to add the line

Code: Select all

sdk.dir=C\:\\Users\\UserName\\AppData\\Local\\Android\\Sdk

replacing UserName with your user name on that computer.

Re: Helloworld on android studio

Posted: Mon Oct 15, 2018 3:07 pm
by brunoramos96
That's the problem. When I searched about this error I found that possible solution, but it doesn't work. I'll try to reinstall the android studio. Old school way :(

Re: Helloworld on android studio

Posted: Tue Feb 26, 2019 5:50 am
by ngetrip
I think eclipse is better. Code make more clear

Re: Helloworld on android studio

Posted: Tue Feb 26, 2019 10:25 am
by jdecoux
If you are developing for Android, it is important to consider that Google ended official Eclipse support in 2016, and recommends Android Studio for future Android development.