peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

PS: "I am using nebeans ide." You do not need to tell us what IDE you are using, it is code that matters...

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

though I do wonder what he's done that makes his eclipse project's compiling dependent on the order of dependencies in the project settings window :)

I do remember NetBeans being funny back in the day while building JME app and you messed up order ;)
But hey then I been student and had no clue about building tools, and been happy IDE did it for me :D

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Above description wouldn't help in solving your issue. If your build is dependent on JRE System Library above/below JUnit.jar it is plainly obvious you are dependent on IDE and your project will not build sucessfuly from command line, therefore cannot be run from CI. I do strongly suggest to check out Gradle or Maven

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Well you have to work out some logic that will find out in which location proximity you are in. Once you identify location it should not be hard either have Map<Location, StringResources> where StringResource is only id to the strings new StringResources(R.string.resource_1, R.string_resource_2). However this is only short term solution, it would be better to send data to server that should return you these data that you want to show user

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

You are misunderstanding concept. This is not jar library that you add to your project, but rather expectation that user has this application installed on device and thereore with help of Android intent you can say "load this url with following application of this package name"

OsaMasw commented: thanks +2
peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

There is no official API yet as this is still under development. However according to VLC forum you just need to do this

Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setPackage("org.videolan.vlc.betav7neon"); // Use org.videolan.vlc for nightly builds
intent.setDataAndType(Uri.parse("http://example.com/media/test.mp4"), "application/mp4");
startActivity(intent);

My suggestion would be to check first for vlc in PackageManager to avoid crash if app not installed. You can follow discussion on intent here

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Without seeing actual code hard to say...

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Add button
1. Setup new layout just with button
2. When adding button inflate this new layout to reduce all that mess with LinearLayout.LayoutParams
3. Then add button to parent (LinearLayout)

Buttons disapeared on fragment return - you need to apply some persistance to record your change, which should happen onPause and re-initiaded with onResume. You could do this with bundle that you pass around. However this will become more complicated as you move around app and other needs to be past to other components.
So you need to decide what storage is best for you http://developer.android.com/guide/topics/data/data-storage.html. For start you may want to use SharedPreferences, if you have more complex structure database would be better.

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Ahhh, OK. Simple, lets examine code (sorry for cheeky comments)

if(new File("ATM.xls").exists()){ //check if file exists
    System.out.println("File exists"); //YES it does exist
    //but I failed to assigned to some object
}
else{
    File excel = new File("ATM.xls");//doesn't exist so I create new file
    //but this go no further because it is local variable
}

So the code should be something like

File excel = new File("ATM.xls");
if(!excel.exists()) {
    try {
        excel.createNewFile();
    } catch(IOException e) {
        Systemout.println("Failed to create new file, \n" + e.getMessage()); //Log framework would be much better instead of system print outs
}
//I have made sure file either exists or is created and now I can continue
peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

That only creates WritableWorkbook, an object to which you have to write some data and then close in order for file to be generated. Check these examples http://www.programcreek.com/java-api-examples/index.php?api=jxl.write.WritableWorkbook

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster
  1. Increase allocated memory to device (You should have minimum 8gb ram on your pc/laptop or emulator will be always slow). Secondary you may want to install HAXM (you do have to run actually manual install once downloaded through Android SDK as it is 3rd party product) you will find it in your ANDROID_SDK_DIRECTORY/extras/intel/Hardware_Accelerated_Execution_Manager
  2. Use Genymotion instead, free registration for personal usage, way faster then default emulator
  3. Get real device, there is nothing better then real device and fast deployment. Motorola Moto G or Moto E cost about £100 ( I call it good investment)
peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster
peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Yes, but that post was Modified 19 June 2011
Also check this recent discussion on Reddit http://www.reddit.com/r/androiddev/comments/2wf2ge/android_sdk_vs_flash_builder_thoughts/

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

@SimonIoa can we please keep discussion to single thread???

As I said in other thread I would not recommend Flash based appplication as it is not supported by Android neither iPhone. However you can do HTML 5, CSS and JavaScript and use stuff like cordova which should help you to create hybrid app that will run on both platforms(Android and iOS). Otherwise you need to do native development.

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

I do only native Android development so I will not be able to help you with this. Have look at http://www.adobe.com/devnet/air/air_for_android.html for articles in regards of this. Also they do have their own forum where you can ask questions and get answers...

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

You aware that Android and iPhones ditched support for Adobe Flash

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

You need to run your music as servive, you can see example here http://developer.android.com/guide/topics/media/mediaplayer.html#mpandservices

jalpesh_007 commented: thanks.it is helpful. +4
peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster
ravi142 commented: @Thank you +2
peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Ohhh dear god, my past is biting me back...

I did wrote this tutorial 6 years ago, hopping to show people how to do scriplet-less Java web development. At the time I had no idea about build tools like Ant, Maven or Gradle and it was common to have lib directory in the project where you will put any library jars and then point your IDE to it to pick up as additional dependencies used in project.

I do not use Eclipse preffer IntelliJ studio, but in Eclipse you should be able to link jar files by doing following Click Properties > Java Build Path > Libraries > Click Add External Jars

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster
peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Sorry for being sarcastic but under which rock you been living? Both iPhone and Android do not support Flash for last 2 years and Adobe is not doing any development on Flash anymore.

You can either use HTML5 or JavaScript

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Sounds like you are missing stuff that is available only with Java EE. Did you installed any Java EE?

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Time is Android represented either by Date or Time objects. Each of these will return result in miliseconds as long variable (http://developer.android.com/reference/java/util/Date.html#getTime() http://developer.android.com/reference/android/text/format/Time.html#toMillis(boolean) ). Then you just need to compare time1 to time2 to find if it is lesser/equal/greater

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Most likely you are missing JDBC driver, or you have duplicate (at least that was problem with Tomcat if you had JDBC driver in Tomcat lib folder and another in your project lib folder).

Without seing your project hard to advice otherwise...

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

If i read it correctly your insertValue R.id.txtInsert is part of R.layout.add_item. If that is case then

final EditText insertValue = (EditText)findViewById(R.id.txtInsert);

will be null because edit text was not found. You have to find it in coresponding view, so it should be like

final EditText insertValue = (EditText) addView.findViewById(R.id.txtInsert);
peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

I'm Android developer so to be fair no idea how services are done with Cordova. However here are some pointers

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

by the way cordova(phonegap)/Titanium is powerful tools to create native mobile apps

These tools are not native, they are cross platform, full stop.
Native mean Android written in Java or iOS writen in Objective C. Not bunch of html & JS or C#. They maybe useful for company that cannot or is not willing to invest in Android and iOS devs, however they will never be fast as native code and will always be behind with latest Android SDK.

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

javascript , html5 and cSS3 is not native android development. PhoneGap is now called Cordova and you can find their documentation here and for Titanium over here

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster
peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster
  1. It is not textView but TextView
  2. Secondly like I mentioned previouly you can format text in similar way like CSS. Each elements of layout can be styled individually or under shared style.

Individual options besides layout_width and layout_height will include

android:background
android:padding
android:paddingBottom
android:paddingTop
android:paddingLeft
android:paddingRight

These in case of TextView expand also to

android:fontFamily
android:textColour
android:textSize
android:TextStyle

and others. Just check out Android API like here for TextView
You can read more about styles here

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

As I mentioned before in your other thread (that you did not close) design for mobile apps is not same as design for web sites.

XML extract of layout that you posted is actually what you need to show image on screen. However beside required stuff you did (layout width & height) there are other things like padding, positioning and more. Also like in HTML with CSS you can do some interesting combinations.

So if you care to explain what you are having difficulties to achieve someone may try to help you. Simply posting image wouldn't help. So we are expecting good description of problem, because your post above does not satisface that...

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Android has a resources folder where you can store various data/objects. One of this folder subfolders is drawable that can be represented also by various screen sizes drawable-hdpi, drawable-mdpi etc

However be warned! Android UI development is not same as web development or iOS "pixel perfect" appraoch.

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

web app is actual website. It is common that what ever response website is getting can be consumed by mobile application as this content is send in JSON format. Here is a list of APIs you may want to have look at http://blog.programmableweb.com/2012/02/28/134-travel-apis-kayak-yahoo-travel-and-hotelscombined/ and maybe you can try to integrate one inside your application

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

No matter which IDE you use there is a logcat which will tell you where error exactly happen. So check it out and stop posting generic error that you see on device screen. You are wasting our time

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Sorry to say, but hardly anyine does Android development on Windows machines down to various issues with configuration. Secondly Eclipse is such mess.

Try to isntall Android SDK from zip instead of automated installation (do not forget to modify your system path and ANDROID_HOME there). Aso I would recommend to use AndroidStudio or IntelliJ.

PS: I hope you have Java 6 32 bit installed and not something else

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

You are performing network activity on UI thread!!! Ggrrrrrrrrrr!!!! This is big NO! Read this http://developer.android.com/training/basics/network-ops/connecting.html

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Do not mix up web development approach with mobile approach. Connectivity is your constrain. There are no guaranies that you wi-fi connection on mobile internet will be fast enough as to instantly query remove service.

Either allow for time delay while querying remote service, or work with sub-set of existing data.

There is no silver bullet...

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

@cool_zephyr I will say it is everyone personal opinion/preference how to proceed. Because as to your recommendation I can say "why to bother with file read/write logic when there is already database connectivity?"

@CoilFyzx it is difficult to give deceisive answer without knowing more about functionality of your application.

1st point, as ong there is no heavy data processing (thousands of entries to go through before displaying result, which means delay before user sees anything) you more then safe to do it on each read

2nd point, you may create special table to hold data of last seen UI, simple if working with single UI view (school assignmen). However that may be impractical if you have multiple UIs you will require number of such tables.

For 3rd point implementation is really up to you if you want to keep config file or database config table, same goes for credentials

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

People may have suggested SharedPreferences because

A. You may want to keep login credentials for future logins, so whenever user encounters login form this will get populated by them and user then only need to press login button to trigger login process of validation and verification
B. You may want to store a token that identifies you as valid logged user, so for future communication with remote service you can safely communicate

PS: Would be also nice of you in future close some topics and give creadit where due example here

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

It's showing 2 errors at br.readLine()

Because line 11 and 13 are supposed to be br.readLine() where you have br.readline

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

pritaeas any specific reason why you want to use 3rd party library that is mix of HTML5 and Ajax instead of native Android code base?

Both frameworks will be always slower then native code, they are more likely introduce various bugs, and they always behind current Android development.

As for the IDEs I do use Android Studio on daily bases and does work great as long you are using Gradle as your build automation tool. However you have to remember this is not official release therefore some stuff is missing like multi module testing, project test coverage

IntelliJ is more round-up IDE given that has longer history (Android Studio is base on IntelliJ so it inheritted lot of good stuff). However advantage of IntelliJ is support of Ant, Maven and Gradle build tools, support for multi module testing and coverage with Cobertura, Emma and Jacoco.

Nevertheless I'm not sure if either of these IDEs support Phonegap or Xamarin.

Sorry if I gave negative opinion on above frameworks, but I'm native Android dev and not really friend of these "cross platform" frameworks

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Well you will need to show at least 2 UI components main text area where game would display info and an input field to get user input for decisions in the game. Wouldn't you...

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Sorry @jrosh but that is not have the forum works "I have problem here is all the crap, deal with it for me because I cannot be bothered". Just because you show some link it doesn't mean you provided evidence of some work as per rules

Do provide evidence of having done some work yourself if posting questions from school or work assignments

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Encaupsulate radio buttons with radio group, that is radio group purpose

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

no I said use on onResume() because onCreate is only executed when activity or fragment is started for first time, but it is not executed when coming back from pause state that mean user moved on different activity or fragment and then he decide to press back button, or perhaps your application was pause down to call or received SMS and user does return back to it and application is started from last know state and that state start with resume. Read on Activity lifecycle here

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

No not possible once you give it fixed value. However you can use layout_weight to make device strech it dynamically. If you ever did any web development with CSS you should find many similarities.

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

I cannot answer thi question as I never played with widgets layouts, but you can have look over here http://developer.android.com/guide/topics/appwidgets/index.html

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

Android SQLite database and content provider - tutorial by Lars Vogel

And yes onResume is better

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

By supporting all densities read more here http://developer.android.com/guide/practices/screens_support.html

peter_budo 2,532 Code tags enforcer Team Colleague Featured Poster

What would be forum when everybody could delete as it please him/her? Just chat...

Take situation someone posts question, you reply to it, the OP doesn't like it and reply in rather rude style, you reply too and whole situation culminates. However before admin/mod can take action OP removes/edit his rude replies to something softer, but your rude replies are there. Who gone get blamed???