Posts by Paulo Rodrigues • 6,280 points
201 posts
-
28
votes2
answers13123
viewsA: Identify if set of coordinates is within a radius on Android
As you said, if the storage is being done in a database MySQL on the server, I imagine you have a call via webservice to fetch this data. Therefore, you can determine your question on the query.…
-
2
votes1
answer514
viewsA: How to get the last device location
The object Locationmanager has the method getLastKnownLocation which you can use for this case, and if successful, it is also possible to get what was the date of this last location, so you…
-
1
votes2
answers7140
viewsA: How do I access a website as an app?
Well, I’ll try to sum it up in a nutshell. Working on top of HTML and depending on the platform, there are certain metadata that you need to include in your Webapp to function properly on a mobile…
-
0
votes1
answer87
viewsA: Open Terminal with Swift
To open any application you can use the command open. The argument -b allows you to identify the application through your package, so to open the terminal you can do so: open -b com.apple.terminal…
-
1
votes2
answers288
viewsA: POST request on Swift does not work
How what is being sent is a JSON, with header and everything, don’t expect to receive your server-side variables (CPF and password) as $_POST['senha'] for example, since it was not a form that was…
-
5
votes2
answers4925
viewsA: Send and receive variable to another page
You need to get these variables from URL first. Answered this same question here, on your second page, you may have something like this: function getParameterByName(name) { name =…
javascriptanswered Paulo Rodrigues 6,280 -
0
votes1
answer659
viewsA: Dynamic layout with invisibility, cannot restore element position
Turns out you’re using View.INVISIBLE, that will just leave your LinearLayout invisible in fact, without "removing" it from its layout, occupying the same space. To work the way you want, simply…
androidanswered Paulo Rodrigues 6,280 -
2
votes1
answer123
viewsA: Doubt of Switch
I’m not sure if I understand your doubt, but if you want to identify the on/off actions of Switch, use the OnCheckedChangeListener for that reason: comum.setOnCheckedChangeListener(new…
-
1
votes2
answers722
viewsA: Return to Fragment without creating it again
If you’re working with Fragments, so you have a manager for them, so you actually only need to instantiate once these Fragments and replace in container as your need. In the creation of its…
-
2
votes1
answer49
viewsA: How to configure Nspredicate to perform filter?
In this case you need a OR and not AND on your terms. Your predicate would have something like this: atributo1 == 'sim' || atributo3 == 'sim' || atributo5 == 'sim' For in this case, there may be yes…
-
4
votes1
answer14680
viewsA: Centralize a textview
You need to change the property layout_width to occupy all parent content and add gravity to center the text. Thus remaining: <TextView android:layout_width="fill_parent"…
androidanswered Paulo Rodrigues 6,280 -
4
votes1
answer1307
viewsA: How to customize the current location marker (GPS) in the Maps api v2 android?
To change the default blue icon that defines the user’s location on your map, you first need to disable the automatic search for this location that is done with the method setMyLocationEnabled. So…
-
1
votes1
answer630
viewsA: Selecting a particular item from a spinner
Once you created programmatically or got your Spinner through a layout, just use the method setSelection passing the desired position as parameter: spinner.setSelection(2);…
androidanswered Paulo Rodrigues 6,280 -
1
votes1
answer659
viewsA: Array of phrases in Java
Do something like this: public void mostrarMensagem(View view) { String[] lista = new String []{"sentence one", "sentence two"}; String randomStr = lista[new Random().nextInt(lista.length)];…
-
2
votes1
answer4475
viewsA: Edit item within Listview
I’m guessing you created a class Itemlistview that has some attribute that defines the text of this line in your list, right? As it does not seem that you are persisting this data (as hard coded),…
-
5
votes3
answers2732
viewsA: When and how to use protocols and delegates?
A practical and very common example to be used is when there is a need to come back with data from a view B which was opened by another view a. One of the methods of communication between these two…
-
1
votes1
answer49
viewsA: How to pass map data to be displayed by another class?
Turns out you can’t just assign to meuMapa another GMSMapView, besides this first being a IBOutlet. As the creation of your map is done dynamically, you also need to add the map to your own view in…
-
4
votes1
answer1847
viewsA: How to distribute iOS apps outside the Appstore
You need the iOS Developer Enterprise Program (200 dollars more than the regular program that costs 99 dollars, or 299 dollars), which in addition to other advantages, will allow you to distribute…
-
1
votes1
answer82
viewsA: How to lock the phone only in the app
Prevent closing your application through the back button is easy, just overwrite the method onBackPressed of his Activity and not fire the super. @Override public void onBackPressed() { //…
androidanswered Paulo Rodrigues 6,280 -
4
votes1
answer7649
viewsA: Button with transparent background
For XML, might be something like that: android:background="#66000000" Where 66 represents 40% of 255 and the rest is the solid colour, in this case black. Or dynamically, after setting the solid…
androidanswered Paulo Rodrigues 6,280 -
0
votes1
answer86
viewsA: 3 levels of Cakephp data
You can use Containable for that. It would look like this: $this->Produto->Behaviors->load('Containable'); $this->Produto->contain('Marca' => array('Fabricante')); $produto =…
cakephpanswered Paulo Rodrigues 6,280 -
1
votes2
answers414
viewsA: How to put a subheading at the bottom of the app name in the bar menu
In his Activity, use the code below to define the title and subtitle, if you are using ActionBar: getActionBar.setTitle("Título"); getActionBar.setSubtitle("Subtítulo"); Or getSupportActionBar if…
androidanswered Paulo Rodrigues 6,280 -
1
votes1
answer140
viewsA: Outlets in Xcode 6 (Universal Application)
In fact it is not possible to make reference to the same IBOutlet if you have different layouts for iPhone and iPad, for example. You drawing a single layout in mode Wany|Hany, note that in the…
-
2
votes1
answer63
viewsA: Restrict iOS versions
Preventing the installation is not possible, but in AppDelegate you can check the version of the device and prevent it from completing the opening according to the version of the operating system.…
-
3
votes2
answers643
viewsA: How to set a time to close image when opening
Do something like this after displaying the image: final Handler handler = new Handler(); handler.postDelayed(new Runnable() { @Override public void run() { imageView1.setVisibility(View.INVISIBLE);…
-
6
votes2
answers5781
viewsA: How to configure an image in Imageview so that it takes the entire screen of the phone
Try including the following property: android:scaleType="fitXY" However, depending on your image, it may not maintain the same quality and proportion, so you have to use a good image for this.…
-
1
votes1
answer310
viewsA: Change file download location
To get the file name you can do something like this: String fileName = dwnload_file_path.substring(dwnload_file_path.lastIndexOf('/') + 1, dwnload_file_path.length()); Or use the class FilenameUtils…
androidanswered Paulo Rodrigues 6,280 -
1
votes2
answers838
viewsA: Map showing search location Swift
Well, since you first need to find the coordinates, maybe the answer is a little broad, but in short, in the iOS there is no method that you pass the address and it returns you latitude and…
-
2
votes1
answer1288
viewsA: How to pass parameters using cakephp redirect?
Supposing that your array $contact be something like that: array( 'nome' => 'Fulano', 'email' => '[email protected]' ); You would have two ways to receive these values in your action. The first…
cakephp-2answered Paulo Rodrigues 6,280 -
3
votes2
answers132
viewsA: Equivalent of onCreate()
From what I understand of your class, you may have something more or less so simplified: public class Session { SharedPreferences prefs; SharedPreferences.Editor prefs_editor; public Session(Context…
androidanswered Paulo Rodrigues 6,280 -
1
votes1
answer92
viewsA: Relationship of Tables with Cakephp
If your relationships are all working properly, just use the FormHelper, as is common, informing the related field that it already mounts for you the <select> correspondent. For example, in…
-
2
votes1
answer421
viewsA: How to Download Files in Cakephp?
You can use the method file() of the object sponse for that. So: $this->response->file( $file['path'], array('download' => true, 'name' => 'foo') );…
cakephp-2answered Paulo Rodrigues 6,280 -
1
votes1
answer81
viewsA: Combo does not display state name
The label name you can include in the second parameter, so: echo $this->Form->input('uf_id', array('label' => 'Estado')); echo $this->Form->input('nom_municipio', array('label' =>…
cakephpanswered Paulo Rodrigues 6,280 -
2
votes2
answers5861
viewsA: Change the line color of an Edittext
The generator Android Holo Colors can help you in this task, or you can create your own drawable to define as your background EditText, but involves more elements like focus color, disabled and etc.…
-
3
votes2
answers805
viewsQ: Asynctask task only runs once, then does not arrive at theInBackground
I am facing a strange problem in my application, since in I am testing in 4 different devices but only two of them have the expected behavior. Scenario / Devices: Nexus 4 / Android 5.0 - OK Galaxy…
-
1
votes1
answer135
viewsA: Recovers image saved in internal memory
Do something like this: String path = context.getFilesDir().toString(); String fileName = "nome_imagem.jpg"; Bitmap bMap = BitmapFactory.decodeFile(path + "/" + fileName); With the Bitmap you can…
-
1
votes1
answer72
viewsA: Disregard HTTP authentication for a given URL
Solved as follows: the two paths that will be ignored by Apache HTTP authentication, both the physical and the one that is applied to URL rewriting by mod_rewrite get like this: SetEnvIf Request_URI…
-
1
votes1
answer301
viewsA: How do I create an external link using cakephp?
Just replace the array of the second parameter by the desired URL. Thus: echo $this->Html->link('YouTube', 'http://www.youtube.com');
-
2
votes1
answer180
viewsA: Parameters for a Container View
Just you simply have a public method in your UITableViewController and execute it by UIViewController. Let’s assume that your UITableViewController has the following method in its header: -…
-
1
votes1
answer72
viewsQ: Disregard HTTP authentication for a given URL
I have an application developed in Cakephp 2, but I believe that the issue does not have as much involvement with the framework itself, just citing to contextualize. Being this private application,…
-
1
votes1
answer59
viewsA: How to use Uibutton icon
System icons are used from the class UIBarButtonSystemItem, consequently only with the component UIBarButtonItem which are available in the navigation bar or Toolbar. That is, it is not possible to…
-
1
votes1
answer291
viewsA: How does android APP versions work?
It is you who defines the version number of your application. In the file Androidmanifest.xml, at the tag itself <manifest> has the properties android:versionCode and android:versionName.…
-
0
votes1
answer63
viewsA: How to use only one music from iPod app library?
There is a library for functions with the iPod. The item in question you will need is the MPMediaItem which is music itself and using the method valueForProperty: you can get some properties that…
-
1
votes1
answer186
viewsA: Obtain latitude and longitude
From the iOS 8 you need a few steps beyond what we were used to before the system upgrade, maybe this was missing in the tutorials you found on the web because I came across this same situation. In…
-
2
votes1
answer454
viewsA: Manipulate json object
What happens is that your home is a array of objects, so try it like this: try { JSONObject JOBJECT = new JSONObject(jsonString); JSONArray array = JOBJECT.getJSONArray("home"); JSONObject…
-
2
votes1
answer1006
viewsA: How is it possible to make an Activity appear only once to the user?
It is no different from login systems as you found or as suggested. Assuming you have one Boasvindasactivity and a Mainactivity (the latter set as main in its file manifest), has something like this…
-
1
votes1
answer357
viewsA: How to prevent Multi Touch from allowing touching two Listview items at the same time
Try using the property splitMotionEvents in the layout of your ListView: android:splitMotionEvents="false"…
-
1
votes1
answer136
viewsA: Android error using Picasso
As you say in the error itself, its variable context is null, and in fact you are not setting any value for it, which in case should be done in the constructor. Modify it to: public…
-
1
votes1
answer50
viewsA: Continue after run() finished
This being an asynchronous request, the answer you will get is at the end of the cycle, and as you well said, right after the execute() you will not get the result immediately. The end of the cycle…
-
1
votes1
answer100
viewsA: Uitableview - Data from Disappearing Table
Okay, I’ve come to an understanding of what you intend to do, and with that, you can’t just "extract" the UITableView from within your controller to put in another view. You will also need to…