Maha Sakka

Ranch Hand
+ Follow
since Jun 21, 2019
Cows and Likes
Cows
Total received
1
In last 30 days
0
Total given
0
Likes
Total received
1
Received in last 30 days
0
Total given
30
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Maha Sakka

I create an Android app with Kotlin, It run successuflly without any error on android studio emulator,
when I generate the apk, and I install it in my android device, It install aslo successuflly,
and I can run it but my problem is for example when I click on any button in UI an error appear as follows :
could not compute caller for function : public constructor CampaignData(name:Kotlin.String?=...) defined in package.models.CampaignData Deserialized ClassConstructorDescriptor
Note that CampaignData is a dataclass. However on an android studio emulator work without any error. I would like to know, what's the meaning of this error and How can I solve it ?

3 months ago
In my android app with kotlin language with IDE Android studio 4.0, I want to share a product which have an image and some other information. I use the Branch Sdk, I added a new module in my project. In AndroidManifest.xml, I add the following instructions :

In my android app with kotlin language with IDE Android studio 4.0, I want to share a product which have an image and some other information. I use the Branch Sdk, I added a new module in my project. In AndroidManifest.xml, I add the following instructions :

In my build.gradle, I added :


Let's move to kotlin code now, I add the following function :


And In the product activity, when I click on share button, I add the following code :


After all this, I couldn't sharing the product detail yet, So, How can I use Branch sdk to share this product ? And where's the problem in my code ?

4 months ago

Junilu Lacar wrote:
But subsequently, you've been referring to ProductData -- so what exactly does the data map contain? Could it be that line that's producing the error?

I mean should that in fact be this?


It just a typo
7 months ago

Junilu Lacar wrote:


I try this code, but the same exception
About "toTypedArray()" it's a mistake
7 months ago
First of all, I would like to thank you for your reply, thank you for your effort also
I try this code :

But, Unfortunately the same exception appear : exception java.lang.ClassCastException: java.util.ArrayList cannot be cast to com.models.Product[]
I will put the value of data when debug, I don't know why this problem appear
Maybe the use of ws and ccoroutine ?


7 months ago

Junilu Lacar wrote:

1. "It didn't work" doesn't really tell us much. Please provide more details. Was there a runtime exception or a compiler error? Did you get unexpected results? Tell us exactly how things "didn't work."


An exception appear, exception java.lang.ClassCastException: java.util.ArrayList cannot be cast to com.models.Product[]

Junilu Lacar wrote:

2. Not sure what "data values is dynamic" has to do with any difficulties you're having.

Re #2, are you thinking that your context might be different because I was manually creating the map in the example I gave?

If so, that doesn't really matter. You're dealing with an abstract data structure, a Map, and the code doesn't really care about how that map was populated with values, nor should it. That's a key point in writing this kind of functional or even object-oriented code, you shouldn't have to care about the implementation, as long as the object adheres to the behavior defined by the interface you're programming to, you should be fine, regardless of where the data had come from.

If that isn't what you're referring to, then please clarify what you mean by "data values is dynamic" and what it has to do with being able to transform the original map to a filtered version of it.


Dynamic, I mean it come from WS, and the values can be changed
Unfortunately, I haven't found a solution yet, I need your  help please
7 months ago

Junilu Lacar wrote:Something like this?

This is the output of that script:

shoes=[Product(name=Nike, qty=1)]
pants=[Product(name=Levis, qty=10), Product(name=Dockers, qty=5)]

You really should strive to stay functional in Kotlin and that means keep things immutable if at all possible. It's a big shift in mindset and the way you think about your program and program objects.



I try the following code but still didn't work

The data values is dynamic
7 months ago

Junilu Lacar wrote:

Just to make sure I'm clear on what your intent is, you want to have a Map<String, Array<Product>> where each Array<Product> contains only Product where availableQuantities > 0, correct?


Yes
7 months ago
In my android app with Kotlin, I have a variable "data" type of Map>,Which Product is a kotlin data class.

Product data class contains var availableQuantities. I want to loop the Map> and conserve only the product with availableQuantities != 0, and update the data variable.How can I do this? Here's my code

But, after running the code an exception appear as the following image : enter image description here
The following image is the description of data :

Please help me, I'm really stuck
How can I correct my code to make it functionnal?
7 months ago
I found a soution, I just change the constraint layout by Relative layout
7 months ago
In my UI, I have a recycler view horizontal, and a recycler view vertical below
But,the bottom recycler view not shown all the items, how can I correct this error ?
7 months ago
I would like to know if there's a dependency that number counter changes number on +/- press
as the following picture below
8 months ago
I solve this problem I just change the method dropdown from "manual" to "none". This will erase everything - then I restart my machine after doing this
and I  use the following command in terminal :
8 months ago
I want to clone a project from bitbucket


but I always gettin this error :

fatal: impossible d'accéder à 'https://bitbucket.org/..../project_android.git/' : Failed to connect to 172.0.0.1 port 3128: Connexion terminée par expiration du délai d'attente
How can I correct this problem ?
8 months ago
I haven't found a solution so far, could you help me please
9 months ago