Helloworld on android studio

Supporting 4.1 and up
brunoramos96
Fresh meat
Posts: 4
Joined: Wed Sep 26, 2018 2:14 pm
Contact:

Helloworld on android studio

Postby brunoramos96 » Sat Oct 06, 2018 8:23 am

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

jdecoux
Labview Developer
Posts: 27
Joined: Mon Nov 13, 2017 10:20 am
Contact:

Re: Helloworld on android studio

Postby jdecoux » Tue Oct 09, 2018 10:53 am

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.

brunoramos96
Fresh meat
Posts: 4
Joined: Wed Sep 26, 2018 2:14 pm
Contact:

Re: Helloworld on android studio

Postby brunoramos96 » Wed Oct 10, 2018 3:15 pm

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

jdecoux
Labview Developer
Posts: 27
Joined: Mon Nov 13, 2017 10:20 am
Contact:

Re: Helloworld on android studio

Postby jdecoux » Wed Oct 10, 2018 3:46 pm

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?

brunoramos96
Fresh meat
Posts: 4
Joined: Wed Sep 26, 2018 2:14 pm
Contact:

Re: Helloworld on android studio

Postby brunoramos96 » Sat Oct 13, 2018 9:22 am

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...

jdecoux
Labview Developer
Posts: 27
Joined: Mon Nov 13, 2017 10:20 am
Contact:

Re: Helloworld on android studio

Postby jdecoux » Mon Oct 15, 2018 10:57 am

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.

brunoramos96
Fresh meat
Posts: 4
Joined: Wed Sep 26, 2018 2:14 pm
Contact:

Re: Helloworld on android studio

Postby brunoramos96 » Mon Oct 15, 2018 3:07 pm

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 :(


Return to “Android”

Who is online

Users browsing this forum: No registered users and 1 guest